UBIFS: fix oops on error path in read_pnode
[firefly-linux-kernel-4.4.55.git] / fs / ubifs / lpt.c
index b2792e84d2452fd37e27991b42c1ab5754044de4..d0dfe7a0dedfdb5c90660f2c7b0c18fd601e5c27 100644 (file)
@@ -1269,10 +1269,9 @@ static int read_pnode(struct ubifs_info *c, struct ubifs_nnode *parent, int iip)
        lnum = branch->lnum;
        offs = branch->offs;
        pnode = kzalloc(sizeof(struct ubifs_pnode), GFP_NOFS);
-       if (!pnode) {
-               err = -ENOMEM;
-               goto out;
-       }
+       if (!pnode)
+               return -ENOMEM;
+
        if (lnum == 0) {
                /*
                 * This pnode was not written which just means that the LEB