linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: fnic: fix error return code in fnic_probe()
@ 2020-12-04  7:47 Zhang Changzhong
  2020-12-07 23:40 ` Karan Tilak Kumar (kartilak)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhang Changzhong @ 2020-12-04  7:47 UTC (permalink / raw)
  To: Satish Kharat, Sesidhar Baddela, Karan Tilak Kumar,
	James E.J. Bottomley, Martin K. Petersen, James Bottomley,
	Mike Christie, Joe Eykholt, Abhijeet Joglekar
  Cc: linux-scsi, linux-kernel

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 5df6d737dd4b ("[SCSI] fnic: Add new Cisco PCI-Express FCoE HBA")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.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 5f8a7ef..4f7befb 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.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] scsi: fnic: fix error return code in fnic_probe()
  2020-12-04  7:47 [PATCH] scsi: fnic: fix error return code in fnic_probe() Zhang Changzhong
@ 2020-12-07 23:40 ` Karan Tilak Kumar (kartilak)
  2020-12-08  1:31 ` Martin K. Petersen
  2020-12-09 17:23 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Karan Tilak Kumar (kartilak) @ 2020-12-07 23:40 UTC (permalink / raw)
  To: Zhang Changzhong, Satish Kharat (satishkh),
	Sesidhar Baddela (sebaddel),
	James E.J. Bottomley, Martin K. Petersen, James Bottomley,
	Mike Christie, Joe Eykholt, Abhijeet Joglekar
  Cc: linux-scsi, linux-kernel

Looks good to me.

Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com>

Regards,
Karan

-----Original Message-----
From: Zhang Changzhong <zhangchangzhong@huawei.com> 
Sent: Thursday, December 3, 2020 11:48 PM
To: Satish Kharat (satishkh) <satishkh@cisco.com>; Sesidhar Baddela (sebaddel) <sebaddel@cisco.com>; Karan Tilak Kumar (kartilak) <kartilak@cisco.com>; James E.J. Bottomley <jejb@linux.ibm.com>; Martin K. Petersen <martin.petersen@oracle.com>; James Bottomley <James.Bottomley@HansenPartnership.com>; Mike Christie <michaelc@cs.wisc.edu>; Joe Eykholt <jeykholt@cisco.com>; Abhijeet Joglekar <abjoglek@cisco.com>
Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: [PATCH] scsi: fnic: fix error return code in fnic_probe()

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Fixes: 5df6d737dd4b ("[SCSI] fnic: Add new Cisco PCI-Express FCoE HBA")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.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 5f8a7ef..4f7befb 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.9.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: fnic: fix error return code in fnic_probe()
  2020-12-04  7:47 [PATCH] scsi: fnic: fix error return code in fnic_probe() Zhang Changzhong
  2020-12-07 23:40 ` Karan Tilak Kumar (kartilak)
@ 2020-12-08  1:31 ` Martin K. Petersen
  2020-12-09 17:23 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2020-12-08  1:31 UTC (permalink / raw)
  To: Zhang Changzhong
  Cc: Satish Kharat, Sesidhar Baddela, Karan Tilak Kumar,
	James E.J. Bottomley, Martin K. Petersen, James Bottomley,
	Mike Christie, Joe Eykholt, Abhijeet Joglekar, linux-scsi,
	linux-kernel


Zhang,

> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: fnic: fix error return code in fnic_probe()
  2020-12-04  7:47 [PATCH] scsi: fnic: fix error return code in fnic_probe() Zhang Changzhong
  2020-12-07 23:40 ` Karan Tilak Kumar (kartilak)
  2020-12-08  1:31 ` Martin K. Petersen
@ 2020-12-09 17:23 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2020-12-09 17:23 UTC (permalink / raw)
  To: James E.J. Bottomley, Mike Christie, Sesidhar Baddela,
	Zhang Changzhong, Karan Tilak Kumar, James Bottomley,
	Satish Kharat, Joe Eykholt, Abhijeet Joglekar
  Cc: Martin K . Petersen, linux-scsi, linux-kernel

On Fri, 4 Dec 2020 15:47:39 +0800, Zhang Changzhong wrote:

> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.

Applied to 5.11/scsi-queue, thanks!

[1/1] scsi: fnic: fix error return code in fnic_probe()
      https://git.kernel.org/mkp/scsi/c/d4fc94fe6557

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-09 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  7:47 [PATCH] scsi: fnic: fix error return code in fnic_probe() Zhang Changzhong
2020-12-07 23:40 ` Karan Tilak Kumar (kartilak)
2020-12-08  1:31 ` Martin K. Petersen
2020-12-09 17:23 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).