UBIFS: check return code of pnode_lookup

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

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
Vasiliy Kulikov 2010-09-05 22:33:04 +04:00 committed by Artem Bityutskiy
parent 0e54c8992a
commit 8c893a5545
1 changed files with 3 additions and 0 deletions

View File

@ -705,6 +705,9 @@ static int make_tree_dirty(struct ubifs_info *c)
struct ubifs_pnode *pnode; struct ubifs_pnode *pnode;
pnode = pnode_lookup(c, 0); pnode = pnode_lookup(c, 0);
if (IS_ERR(pnode))
return PTR_ERR(pnode);
while (pnode) { while (pnode) {
do_make_pnode_dirty(c, pnode); do_make_pnode_dirty(c, pnode);
pnode = next_pnode_to_dirty(c, pnode); pnode = next_pnode_to_dirty(c, pnode);