[PATCH 2/4] UBIFS: Add missing error handling in dump_lpt_leb()
hujianyang
hujianyang at huawei.com
Tue Jun 10 19:40:10 PDT 2014
This patch checks the return value of ubifs_unpack_nnode().
If this function returns an error, @nnode may not be
initialized, so just print an error mesg and break.
Signed-off-by: hujianyang <hujianyang at huawei.com>
---
fs/ubifs/lpt_commit.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c
index 4b826ab..7e957b6 100644
--- a/fs/ubifs/lpt_commit.c
+++ b/fs/ubifs/lpt_commit.c
@@ -1941,6 +1941,11 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum)
pr_err("LEB %d:%d, nnode, ",
lnum, offs);
err = ubifs_unpack_nnode(c, p, &nnode);
+ if (err) {
+ pr_err("failed to unpack_node, error %d\n",
+ err);
+ break;
+ }
for (i = 0; i < UBIFS_LPT_FANOUT; i++) {
pr_cont("%d:%d", nnode.nbranch[i].lnum,
nnode.nbranch[i].offs);
--
1.8.1.4
More information about the linux-mtd
mailing list