Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2336357pxb; Sun, 15 Nov 2020 00:34:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZVHv8n6U7OX10v6fzGCoC3rmwDe4N+qf2G+tKiMfuHVnKIkVDbHc1xT9rO/138ZwDPtzT X-Received: by 2002:a17:906:4a98:: with SMTP id x24mr9514191eju.304.1605429272696; Sun, 15 Nov 2020 00:34:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605429272; cv=none; d=google.com; s=arc-20160816; b=ysJP03fnrsUsdhlmCBXmgK8DeC0f81A+69eKBn6Ml74Q27Te+/Ah7rcQypZsWtBZMC tb7N69+4UAfU1IcasTkZD+8iIonbmwdWp3XuroH0mxSxrmIVHhXQ4XkSwrE38Yp3eiRV ux9baxFXLKthICzWoGmvoizhml84Ijmurx5uxKcYdGn57Xd6Et0KDn7GmBq/6ANetmLr gsBQ9nxbTslmlhCN18wbyLqBHQLvqRCxQ/3SKDFHv5kH3zK46YI8SroGF0SQ7P/MkARF 6ifT7gAP7yvkMD9UaUCLNbshk9blIKvNdDmCBWO3QcJfl5vmTazCqjzy5BX9YJ1MNIL+ /gTg== 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=NbZZMYj2gmy+ZshJD6gZSlZ6A0xWIOD0Y5fIfMi5Jt8=; b=q5409ESbYYGKxmK++kPCbDW14bRkJhHcLBSgC9Xo8a+1HmPKHhZfyg1foXsGDyK5Kd AW6emWp0D+6PtM55X3ExwufyyKnKfKfvkOYRfI9YjjTXQGDF4Gg3eg0a3fF87UZU0m83 2DmL3+vb3x1zfu71rBBPP9iVr7mtjqxaR0XGMpL/04BQdQiuiXfkWNELovCt1h+HfGKy +TeA40T0MxX4e442Clz6LuXvjRx9A4AEcKCT9UYwYVXAZJUiz1iZ3cquCQty2Nuo0pR6 Okg9dD4DNNcZM6w/qQrR80wlviBFeXXxEAKbEAqnvrH7QPdo/dUDWot69+MMjNn6u9Be IRow== 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 rk26si9562995ejb.453.2020.11.15.00.34.10; Sun, 15 Nov 2020 00:34:32 -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 S1726631AbgKOIYE (ORCPT + 99 others); Sun, 15 Nov 2020 03:24:04 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7193 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbgKOIYE (ORCPT ); Sun, 15 Nov 2020 03:24:04 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CYlbN17z3z15LFN; Sun, 15 Nov 2020 16:23:44 +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; Sun, 15 Nov 2020 16:23:47 +0800 From: Wang ShaoBo To: CC: , , , , Subject: [PATCH] bdi: Fix error return code in alloc_wbufs() Date: Sun, 15 Nov 2020 16:23:43 +0800 Message-ID: <20201115082343.35645-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 instead fo 0 in function alloc_wbufs(), as done elsewhere in this function. Fixes: 6a98bc4614de ("ubifs: Add authentication nodes to journal") Signed-off-by: Wang ShaoBo --- fs/ubifs/super.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index cb3acfb7dd1f..dacbb999ae34 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -838,8 +838,10 @@ static int alloc_wbufs(struct ubifs_info *c) c->jheads[i].wbuf.jhead = i; c->jheads[i].grouped = 1; c->jheads[i].log_hash = ubifs_hash_get_desc(c); - if (IS_ERR(c->jheads[i].log_hash)) + if (IS_ERR(c->jheads[i].log_hash)) { + err = PTR_ERR(c->jheads[i].log_hash); goto out; + } } /* -- 2.25.1