[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20201116024138.22519-1-wangkefeng.wang@huawei.com>
Date: Mon, 16 Nov 2020 10:41:38 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: "Martin K . Petersen" <martin.petersen@...cle.com>,
<linux-kernel@...r.kernel.org>, <linux-scsi@...r.kernel.org>
CC: Satish Kharat <satishkh@...co.com>,
Karan Tilak Kumar <kartilak@...co.com>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
Hulk Robot <hulkci@...wei.com>
Subject: [PATCH] scsi: fnic: Fix error return in fnic_probe
If mempool_create_slab_pool fails, return -ENOMEM.
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
---
drivers/scsi/fnic/fnic_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index 5f8a7ef8f6a8..4f7befb43d60 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -740,6 +740,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
for (i = 0; i < FNIC_IO_LOCKS; i++)
spin_lock_init(&fnic->io_req_lock[i]);
+ err = -ENOMEM;
fnic->io_req_pool = mempool_create_slab_pool(2, fnic_io_req_cache);
if (!fnic->io_req_pool)
goto err_out_free_resources;
--
2.26.2
Powered by blists - more mailing lists