From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38DEAC4332D for ; Mon, 28 Dec 2020 13:51:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0889422BF5 for ; Mon, 28 Dec 2020 13:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732668AbgL1NvQ (ORCPT ); Mon, 28 Dec 2020 08:51:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:52814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406476AbgL1Nu7 (ORCPT ); Mon, 28 Dec 2020 08:50:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 16C3220791; Mon, 28 Dec 2020 13:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609163418; bh=kD1KJvfZabHqHTEzjZ43wMKSV+u8GPIAS9zryJIfk4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RKkYIyx4iO88NJb8+wn+btdBplLdLfn3r6QAj95ZwGxd/voJLGpD8153pbyucNiPO fDiec+fw74AkCP2eBmnz6W55lGp0Q8MFwZbd+ioCe7p3jw+Eqlg9RSfaCwm1H0Dbvo osjx3qxs9AhMPiDsuaDpmMot1TDswfpanjTtQbmw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wang ShaoBo , Sascha Hauer , Richard Weinberger , Sasha Levin Subject: [PATCH 5.4 280/453] ubifs: Fix error return code in ubifs_init_authentication() Date: Mon, 28 Dec 2020 13:48:36 +0100 Message-Id: <20201228124950.684089150@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wang ShaoBo [ 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 --- fs/ubifs/auth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.27.0