1
0
Fork 0

ubifs: Fix error return code in ubifs_init_authentication()

[ Upstream commit 3cded66330 ]

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: 49525e5eec ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5.4-rM2-2.2.x-imx-squashed
Wang ShaoBo 2020-11-24 14:33:20 +08:00 committed by Greg Kroah-Hartman
parent d4dbcfb7e1
commit a37d283825
1 changed files with 3 additions and 1 deletions

View File

@ -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;