ubifs: check return code of ubifs_lpt_lookup
PATCH 11/14 ubifs: check return code of ubifs_lpt_lookup
From: Vasiliy Kulikov <[email protected]>
Function ubifs_lpt_lookup may return ERR_PTR(...). Check for it.
Signed-off-by Vasiliy Kulikov <[email protected]>
---
Compile tested.
fs/ubifs/lpt.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
fs/ubifs/lpt.c +6 -1
@@ -1351,6 +1351,7 @@ static int read_lsave(struct ubifs_info *c) {int err, i;void *buf; +struct ubifs_lprops *perr; buf =vmalloc (c->lsave_sz);if (!buf)
@@ -1370,7 +1371,11 @@ static int read_lsave(struct ubifs_info *c)*/ if (lnum >= c->leb_cnt)continue ; -ubifs_lpt_lookup (c, lnum); + perr =ubifs_lpt_lookup (c, lnum); +if (IS_ERR (perr)) { + err =PTR_ERR (perr); + goto out; + } } out:vfree (buf);
Signature · 1 line
1.7.0.4
Quoted 6 lines · Kulikov Vasiliy
From: Vasiliy Kulikov <[email protected]>
Function
ubifs_lpt_lookupmay returnERR_PTR(...). Check for it.Signed-off-by Vasiliy Kulikov <[email protected]>---
Pushed both patches to the UBIFS tree, thanks:
http://git.infradead.org/ubifs-2.6.git
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)