summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang ShaoBo <bobo.shaobowang@huawei.com>2020-11-24 14:33:20 +0800
committerRichard Weinberger <richard@nod.at>2020-12-13 21:57:20 +0100
commit3cded66330591cfd2554a3fd5edca8859ea365a2 (patch)
tree72df6e774d36d93acf0d32cc786c9121293d1281
parent20f1431160c6b590cdc269a846fc5a448abf5b98 (diff)
ubifs: Fix error return code in ubifs_init_authentication()
Fix to return PTR_ERR() error code from the error handling case where ubifs_hash_get_desc() failed instead of 0 in ubifs_init_authentication(), as done elsewhere in this function. Fixes: 49525e5eecca5 ("ubifs: Add helper functions for authentication support") 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>
-rw-r--r--fs/ubifs/auth.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ubifs/auth.c b/fs/ubifs/auth.c
index b93b3cd10bfd..8c50de693e1d 100644
--- a/fs/ubifs/auth.c
+++ b/fs/ubifs/auth.c
@@ -338,8 +338,10 @@ int ubifs_init_authentication(struct ubifs_info *c)
c->authenticated = true;
c->log_hash = ubifs_hash_get_desc(c);
- if (IS_ERR(c->log_hash))
+ if (IS_ERR(c->log_hash)) {
+ err = PTR_ERR(c->log_hash);
goto out_free_hmac;
+ }
err = 0;