summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasiliy Kulikov <segooon@gmail.com>2010-09-05 20:33:00 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-07 11:09:41 +0200
commit0e54c8992a35ab8126e8a7661007ddc1745a2597 (patch)
treeda9652f72841fefb23f261fc824af0c36e089061
parentUBIFS: improve error reporting when reading bad node (diff)
downloadlinux-0e54c8992a35ab8126e8a7661007ddc1745a2597.tar.xz
linux-0e54c8992a35ab8126e8a7661007ddc1745a2597.zip
UBIFS: check return code of ubifs_lpt_lookup
Function ubifs_lpt_lookup may return ERR_PTR(...). Check for it. [Tweaked by Artem Bityutskiy] Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--fs/ubifs/lpt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c
index 0084a33c4c69..72775d35b99e 100644
--- a/fs/ubifs/lpt.c
+++ b/fs/ubifs/lpt.c
@@ -1363,6 +1363,7 @@ static int read_lsave(struct ubifs_info *c)
goto out;
for (i = 0; i < c->lsave_cnt; i++) {
int lnum = c->lsave[i];
+ struct ubifs_lprops *lprops;
/*
* Due to automatic resizing, the values in the lsave table
@@ -1370,7 +1371,11 @@ static int read_lsave(struct ubifs_info *c)
*/
if (lnum >= c->leb_cnt)
continue;
- ubifs_lpt_lookup(c, lnum);
+ lprops = ubifs_lpt_lookup(c, lnum);
+ if (IS_ERR(lprops)) {
+ err = PTR_ERR(lprops);
+ goto out;
+ }
}
out:
vfree(buf);