Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1584405pxu; Tue, 24 Nov 2020 04:11:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIrcjmh96v8GQMlXeN6jXnBfcW5mZepokbnxtZSqPLUs7bMRifs2G3PfzB4f0e4oQ24v7F X-Received: by 2002:aa7:ccda:: with SMTP id y26mr3776181edt.123.1606219874499; Tue, 24 Nov 2020 04:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606219874; cv=none; d=google.com; s=arc-20160816; b=Il6mdcPvlb2em6B/YAY68PALnUQdlltTFLRdceQEeJAWrUUOWwk6IBopQCV2+SK/ne egD0Z0k8EuxItTFIhc7ZTycJarl8SHwUC2YPyfwjYwBXtA5mVg7WeD1higiuIbBwO54c eCG1U+HKW/DaSYI01+iGXx1hquQh4Shkg3K9JCLddkUeO3wSh2UzyA8OBzTdjrTRXi7a QtKZ1vfSg5vqkIR6OICiQYPn86F6dvDyEvrGuHifB/VwPrvHit6aT0lQQ6cbHohVtQ6/ WAgEkVQULGHYRhMl3VvfALg6VMZnT+Y+D93E+dNKF2KzzQajN08GV5Ep3Ml839pCioSl uvZA== 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=Wmeh0AWuIrIoQL3+2C20x5/+iT3aJWotpB5iCoJTNkg=; b=OkzaUzAk92HrJFDyblTYFI2YHr9jzVZJ+1idYuRJ11hXX96KYy12IfVvlOCu5yYnA4 3Uni2EB9imEl/exs9ZPAnC3onZmwmjGSefe2uHIPJJigrT3IxZIZoW0YUZBSBBM0S6qk mQx80TC32D+y4WZvu5zZQi7AylNt/Acckmja3+WeeBxSV8WvuiQmvdJ1MX8LtFwBVSdv aoNAIYUz+7wFAwVFwCD4Sqmq8iro5uuVGZoLzakxInjARZTNk2YFFtcioV37dYgEB/vQ PpIhP+CRkWNMqaNyw84APV8jYLZM2LipiGXPZ2QYJD9GkVHFK70mApuB5SFpDKEwADdM lbeg== 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 y9si10492345edp.443.2020.11.24.04.10.26; Tue, 24 Nov 2020 04:11:14 -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 S1733194AbgKXMFH (ORCPT + 99 others); Tue, 24 Nov 2020 07:05:07 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8579 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729172AbgKXMFG (ORCPT ); Tue, 24 Nov 2020 07:05:06 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CgN445YfGzLpwc; Tue, 24 Nov 2020 20:04:36 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Tue, 24 Nov 2020 20:04:50 +0800 From: Wang ShaoBo To: CC: , , , , , Subject: [PATCH v2] ubifs: Fix error return code in alloc_wbufs() Date: Tue, 24 Nov 2020 20:04:46 +0800 Message-ID: <20201124120446.12359-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. 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.17.1