Commit 0e54c8992a35ab8126e8a7661007ddc1745a2597

Authored by Vasiliy Kulikov
Committed by Artem Bityutskiy
1 parent 3a8fa0ed3e

UBIFS: check return code of ubifs_lpt_lookup

Function ubifs_lpt_lookup may return ERR_PTR(...). Check for it.

[Tweaked by Artem Bityutskiy]

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

Showing 1 changed file with 6 additions and 1 deletions Side-by-side Diff

... ... @@ -1363,6 +1363,7 @@
1363 1363 goto out;
1364 1364 for (i = 0; i < c->lsave_cnt; i++) {
1365 1365 int lnum = c->lsave[i];
  1366 + struct ubifs_lprops *lprops;
1366 1367  
1367 1368 /*
1368 1369 * Due to automatic resizing, the values in the lsave table
... ... @@ -1370,7 +1371,11 @@
1370 1371 */
1371 1372 if (lnum >= c->leb_cnt)
1372 1373 continue;
1373   - ubifs_lpt_lookup(c, lnum);
  1374 + lprops = ubifs_lpt_lookup(c, lnum);
  1375 + if (IS_ERR(lprops)) {
  1376 + err = PTR_ERR(lprops);
  1377 + goto out;
  1378 + }
1374 1379 }
1375 1380 out:
1376 1381 vfree(buf);