Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1416689pxu; Mon, 23 Nov 2020 22:36:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyk5O2t5EOdWzJX+JYtK4a8yQe+aO+aGQxqLcZucW2TwZyXgjhAqpd0fgyCfqFSZOCemcM3 X-Received: by 2002:a17:906:dbd6:: with SMTP id yc22mr2976716ejb.252.1606199808328; Mon, 23 Nov 2020 22:36:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606199808; cv=none; d=google.com; s=arc-20160816; b=H+APhBkKK5noWUrnzf26us/vRDOdAdxz5Qf6xfxAaLy9bCmyIf9epCvkF/XoRaJxsc W6qzmhYjNR0N2qYJD656JCY0wBygYpWLAFER3+L0Cond3bbBkPdV++QMJ2r7EPTbwhIt nU++5PFjNzvbSrTAQ+LWf2suAGSCPo/WudmNY9YNbnc3u2e/6iChbUl0V+dX1i5WdRBT y+LNEi/uWEprFrX1lqO//mRGgTreyayJI1YzO/jWgtB0OudM72sQf35XZvZqO60C7OhT T6wvnSbnlXdqcI5WOni9j5/V/Vi9bcRgjU4UfHbt9Z+x75DZ4CvdkiISnB18TDCjhDql opbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=9j6LJMXofQ741U3pFJZ/GBYKLpz0cPgmFre8SKDHDLM=; b=AvgjEt/zYyVngLowF/9b2Ujgr2JEt1mIk5Vjj5UPovc9+bhqCHONTo/2nbIkpMZFWh vvsmH4V0aiBvV/lw0wJXvGJqmX2a/95XPEkX6b/uM0tq6XiNZGF4njfkJLzKiIcAxt1O zyOwMPWV29zewE1E6VrOW00hvnjGjB8xC1DN6Hab4tGv7YWcRQ1m2EtDLl9kQShrY+Y+ 3KzErJtAwMakrfy6QgIhEuVF8RppDeEeCK91vNGzttdUAZ+8Na1/BMe/uDLMI2U05gG5 pvAkQa9HzCMPunaiyGWuWlsbRuKSE2FhNGmDLg5pgR+F8KT69BezW1xWTCgiZV8S4QId /2BA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si4055973ejo.278.2020.11.23.22.36.25; Mon, 23 Nov 2020 22:36:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729712AbgKXGdl (ORCPT + 99 others); Tue, 24 Nov 2020 01:33:41 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:8394 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727099AbgKXGdk (ORCPT ); Tue, 24 Nov 2020 01:33:40 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CgDjn5nzLz72HV; Tue, 24 Nov 2020 14:33:17 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Tue, 24 Nov 2020 14:33:26 +0800 From: Wang ShaoBo To: CC: , , , , , Subject: [PATCH] ubifs: Fix error return code in ubifs_init_authentication() Date: Tue, 24 Nov 2020 14:33:20 +0800 Message-ID: <20201124063320.1799-1-bobo.shaobowang@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 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; -- 2.17.1