diff options
author | hujianyang <hujianyang@huawei.com> | 2014-06-10 22:40:10 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-07-19 02:53:51 -0400 |
commit | 5a95741a574f69c8219d3164d1fbf1c855566afe (patch) | |
tree | d162ae6e5ccd57731a3801e83483ba6d9ba51fe2 /fs/ubifs | |
parent | 033ead8230c2cf9cdc2d6e1148bfdf5674012a9c (diff) |
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 <hujianyang@huawei.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/lpt_commit.c | 5 |
1 files changed, 5 insertions, 0 deletions
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) | |||
1941 | pr_err("LEB %d:%d, nnode, ", | 1941 | pr_err("LEB %d:%d, nnode, ", |
1942 | lnum, offs); | 1942 | lnum, offs); |
1943 | err = ubifs_unpack_nnode(c, p, &nnode); | 1943 | err = ubifs_unpack_nnode(c, p, &nnode); |
1944 | if (err) { | ||
1945 | pr_err("failed to unpack_node, error %d\n", | ||
1946 | err); | ||
1947 | break; | ||
1948 | } | ||
1944 | for (i = 0; i < UBIFS_LPT_FANOUT; i++) { | 1949 | for (i = 0; i < UBIFS_LPT_FANOUT; i++) { |
1945 | pr_cont("%d:%d", nnode.nbranch[i].lnum, | 1950 | pr_cont("%d:%d", nnode.nbranch[i].lnum, |
1946 | nnode.nbranch[i].offs); | 1951 | nnode.nbranch[i].offs); |