From: hujianyang Date: Wed, 11 Jun 2014 02:40:10 +0000 (+0800) Subject: UBIFS: fix error handling in dump_lpt_leb() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5a95741a574f69c8219d3164d1fbf1c855566afe;p=linux-beck.git UBIFS: fix error handling in dump_lpt_leb() 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 message and break. Signed-off-by: hujianyang Signed-off-by: Artem Bityutskiy --- diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index 45d4e96a6bac..ff47893ad5fd 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);