Skip to content

Commit

Permalink
UBIFS: fix error handling in dump_lpt_leb()
Browse files Browse the repository at this point in the history
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 <hujianyang@huawei.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
hujianyang authored and dedekind committed Jul 19, 2014
1 parent 033ead8 commit 5a95741
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/ubifs/lpt_commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5a95741

Please sign in to comment.