Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp41056pxj; Wed, 16 Jun 2021 19:43:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIgqJiy+zfHSpobFvWmbb+gWcpiMC0nXou/NMXaZeR2+KtKNcmCQqXns7QVwLAZj8zsWA2 X-Received: by 2002:a6b:e40a:: with SMTP id u10mr1949505iog.200.1623897830312; Wed, 16 Jun 2021 19:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623897830; cv=none; d=google.com; s=arc-20160816; b=HeDWRCXEkWmNCdCN9xb36Tc7Oh/oQtUxcTg73bycID5E2QmcNL6JyTDsnYZb5TdttF DIAsBfP8AzTK+7fmpj0isI0bAfqiMad55Uytv4c2mQc0FEeWm3m4aQQLkyjPEqzX9hLh 3EEvPuxrNpuih+cuaaXsXHjJnSTHLTWyY/BSl+rlPBJJrsAo/70lPn5yMg3MxwY1G3+N Sm15vCNJowOLkifbt0nSOFRS0spw8+oUmDMGCnoaT2gbugn27sshy4OATsfTlKx05tnj ag0FnwFCOgp8vfv3JSIepm8goup+Xg31FpAcyi+UTegiqV5xQCkBr+SJvOt7ooBgfutG 09MA== 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=LV/99SBbomzbePgFATDoi7OdbhhVHGfuAhWglkpDnwc=; b=vHXuOeRr/3ROMEXHf4tIVbQLT2/fiDuNLKbnPaw8NQaG7iOO5qaugqqaNtB+iLGoZG WThqk3i7sAIZ1PvxGJkyRlHE6FYtyhke8VDmcuwEMQ8gWNyjU6QSZNK7uIbjzyRyLLbH PNDkGjKspZeTXCkRRBuGpeG62t8+I9wDs5GZ1ZYkBwaTpefydSWoMjAlIkW/6d0fnvO1 LgPjL03ZUNNaxOn0fUCtCEjCYszsoKyItJXqb8z+tF/WoXhyvT9XNP/zYypdEZuNZUo2 6DYrxrVAvUpSeSwq6glz03Afnm9nz8ChDbTGb57nYfJ49CdMXlC3Zho/HERyLken0qj9 WEyw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m6si4580820iol.83.2021.06.16.19.43.38; Wed, 16 Jun 2021 19:43:50 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231514AbhFQAzm (ORCPT + 99 others); Wed, 16 Jun 2021 20:55:42 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7459 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbhFQAzm (ORCPT ); Wed, 16 Jun 2021 20:55:42 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G53Pn4blrzZj4k; Thu, 17 Jun 2021 08:50:37 +0800 (CST) Received: from dggpemm500019.china.huawei.com (7.185.36.180) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 08:53:33 +0800 Received: from ubuntu1804.huawei.com (10.67.174.98) by dggpemm500019.china.huawei.com (7.185.36.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 08:53:33 +0800 From: Pu Lehui To: , , , CC: , , Subject: [PATCH -next] pstore/blk: Fix return value check in pstore_blk_init() Date: Thu, 17 Jun 2021 08:54:24 +0800 Message-ID: <20210617005424.182305-1-pulehui@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.98] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500019.china.huawei.com (7.185.36.180) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the return value check which testing the wrong variable in pstore_blk_init(). Signed-off-by: Pu Lehui --- fs/pstore/blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c index ccfb11ee4d50..d5e22e6209a6 100644 --- a/fs/pstore/blk.c +++ b/fs/pstore/blk.c @@ -287,7 +287,7 @@ static int __init pstore_blk_init(void) struct pstore_device_info *best_effort_dev; best_effort_dev = kzalloc(sizeof(*best_effort_dev), GFP_KERNEL); - if (!best_effort) { + if (!best_effort_dev) { ret = -ENOMEM; goto unlock; } -- 2.17.1