From: Wang ShaoBo Date: Tue, 24 Nov 2020 06:33:20 +0000 (+0800) Subject: ubifs: Fix error return code in ubifs_init_authentication() X-Git-Tag: v5.4.86~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a37d283825a48dc3ec70fe2193cb69b1b34596eb;p=thirdparty%2Fkernel%2Fstable.git ubifs: Fix error return code in ubifs_init_authentication() [ Upstream commit 3cded66330591cfd2554a3fd5edca8859ea365a2 ] 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 Reviewed-by: Sascha Hauer Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- diff --git a/fs/ubifs/auth.c b/fs/ubifs/auth.c index f985a3fbbb36a..b10418b5fb719 100644 --- a/fs/ubifs/auth.c +++ b/fs/ubifs/auth.c @@ -352,8 +352,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;