UBIFS: check return code of pnode_lookup
authorVasiliy Kulikov <segooon@gmail.com>
Sun, 5 Sep 2010 18:33:04 +0000 (22:33 +0400)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 7 Sep 2010 09:10:43 +0000 (12:10 +0300)
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>
fs/ubifs/lpt_commit.c

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