]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ubifs: Fix error return code in ubifs_init_authentication()
authorWang ShaoBo <bobo.shaobowang@huawei.com>
Tue, 24 Nov 2020 06:33:20 +0000 (14:33 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Jan 2021 13:26:08 +0000 (14:26 +0100)
BugLink: https://bugs.launchpad.net/bugs/1910822
[ 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 <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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/ubifs/auth.c

index f985a3fbbb36a15e202a7b31c80dff518b5651cf..b10418b5fb719e5667e26d3c089242f7aaa45ae9 100644 (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;