ubifs: Fix error return code in alloc_wbufs()
authorWang ShaoBo <bobo.shaobowang@huawei.com>
Sun, 15 Nov 2020 08:23:43 +0000 (16:23 +0800)
committerRichard Weinberger <richard@nod.at>
Sat, 13 Feb 2021 21:58:44 +0000 (22:58 +0100)
Fix to return PTR_ERR() error code from the error handling case instead
fo 0 in function alloc_wbufs(), as done elsewhere in this function.

Fixes: 6a98bc4614de ("ubifs: Add authentication nodes to journal")
Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/super.c

index 138b9426c6c18abc0f9a8e215b03487f88f006d9..ddb2ca636c93dd23ef797190c4ebe6f71e59e986 100644 (file)
@@ -838,8 +838,10 @@ static int alloc_wbufs(struct ubifs_info *c)
                c->jheads[i].wbuf.jhead = i;
                c->jheads[i].grouped = 1;
                c->jheads[i].log_hash = ubifs_hash_get_desc(c);
-               if (IS_ERR(c->jheads[i].log_hash))
+               if (IS_ERR(c->jheads[i].log_hash)) {
+                       err = PTR_ERR(c->jheads[i].log_hash);
                        goto out;
+               }
        }
 
        /*