Prechádzať zdrojové kódy

UBIFS: Fix dump messages in ubifs_dump_lprops

Function ubifs_read_one_lp will not set @lp and returns
an error when ubifs_read_one_lp failed. We should not
perform ubifs_dump_lprop in this case because @lp is not
initialized as we wanted.

Signed-off-by: hujianyang <hujianyang@huawei.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
hujianyang 11 rokov pred
rodič
commit
dac3698147
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  1. 3 1
      fs/ubifs/debug.c

+ 3 - 1
fs/ubifs/debug.c

@@ -745,8 +745,10 @@ void ubifs_dump_lprops(struct ubifs_info *c)
 
 	for (lnum = c->main_first; lnum < c->leb_cnt; lnum++) {
 		err = ubifs_read_one_lp(c, lnum, &lp);
-		if (err)
+		if (err) {
 			ubifs_err("cannot read lprops for LEB %d", lnum);
+			continue;
+		}
 
 		ubifs_dump_lprop(c, &lp);
 	}