summary refs log tree commit diff
path: root/fs/ubifs
diff options
context:
space:
mode:
authorWang ShaoBo <bobo.shaobowang@huawei.com>2020-11-15 16:23:43 +0800
committerRichard Weinberger <richard@nod.at>2021-02-13 22:58:44 +0100
commit42119dbe571eb419dae99b81dd20fa42f47464e1 (patch)
tree2827b358fa5fca1f1936931ca83ee22e1672005c /fs/ubifs
parent90ada91f4610c5ef11bc52576516d96c496fc3f1 (diff)
downloadlinux-42119dbe571eb419dae99b81dd20fa42f47464e1.tar.gz
ubifs: Fix error return code in alloc_wbufs()
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>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/super.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 138b9426c6c1..ddb2ca636c93 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -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;
+		}
 	}
 
 	/*