linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: storvsc: Fix error return in storvsc_probe()
@ 2020-11-27  3:02 Jing Xiangfeng
  2020-11-29 16:47 ` Michael Kelley
  2020-12-01  6:06 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Jing Xiangfeng @ 2020-11-27  3:02 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin, wei.liu, jejb, martin.petersen, longli, cavery
  Cc: linux-hyperv, linux-scsi, linux-kernel, jingxiangfeng

Fix to return a error code "-ENOMEM" from the error handling case
instead of 0.

Fixes: 436ad9413353 ("scsi: storvsc: Allow only one remove lun work item to be issued per lun")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
---
 drivers/scsi/storvsc_drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 0c65fbd41035..ded00a89bfc4 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1994,8 +1994,10 @@ static int storvsc_probe(struct hv_device *device,
 			alloc_ordered_workqueue("storvsc_error_wq_%d",
 						WQ_MEM_RECLAIM,
 						host->host_no);
-	if (!host_dev->handle_error_wq)
+	if (!host_dev->handle_error_wq) {
+		ret = -ENOMEM;
 		goto err_out2;
+	}
 	INIT_WORK(&host_dev->host_scan_work, storvsc_host_scan);
 	/* Register the HBA and start the scsi bus scan */
 	ret = scsi_add_host(host, &device->device);
-- 
2.22.0


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

* RE: [PATCH] scsi: storvsc: Fix error return in storvsc_probe()
  2020-11-27  3:02 [PATCH] scsi: storvsc: Fix error return in storvsc_probe() Jing Xiangfeng
@ 2020-11-29 16:47 ` Michael Kelley
  2020-12-01  6:06 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Kelley @ 2020-11-29 16:47 UTC (permalink / raw)
  To: Jing Xiangfeng, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
	wei.liu, jejb, martin.petersen, Long Li, cavery
  Cc: linux-hyperv, linux-scsi, linux-kernel

From: Jing Xiangfeng <jingxiangfeng@huawei.com> Sent: Thursday, November 26, 2020 7:02 PM
> 
> Fix to return a error code "-ENOMEM" from the error handling case
> instead of 0.
> 
> Fixes: 436ad9413353 ("scsi: storvsc: Allow only one remove lun work item to be issued per
> lun")
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
> ---
>  drivers/scsi/storvsc_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 0c65fbd41035..ded00a89bfc4 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -1994,8 +1994,10 @@ static int storvsc_probe(struct hv_device *device,
>  			alloc_ordered_workqueue("storvsc_error_wq_%d",
>  						WQ_MEM_RECLAIM,
>  						host->host_no);
> -	if (!host_dev->handle_error_wq)
> +	if (!host_dev->handle_error_wq) {
> +		ret = -ENOMEM;
>  		goto err_out2;
> +	}
>  	INIT_WORK(&host_dev->host_scan_work, storvsc_host_scan);
>  	/* Register the HBA and start the scsi bus scan */
>  	ret = scsi_add_host(host, &device->device);
> --
> 2.22.0

Reviewed-by: Michael Kelley <mikelley@microsoft.com>


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

* Re: [PATCH] scsi: storvsc: Fix error return in storvsc_probe()
  2020-11-27  3:02 [PATCH] scsi: storvsc: Fix error return in storvsc_probe() Jing Xiangfeng
  2020-11-29 16:47 ` Michael Kelley
@ 2020-12-01  6:06 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-12-01  6:06 UTC (permalink / raw)
  To: cavery, longli, jejb, wei.liu, kys, sthemmin, Jing Xiangfeng, haiyangz
  Cc: Martin K . Petersen, linux-scsi, linux-hyperv, linux-kernel

On Fri, 27 Nov 2020 11:02:06 +0800, Jing Xiangfeng wrote:

> Fix to return a error code "-ENOMEM" from the error handling case
> instead of 0.

Applied to 5.10/scsi-fixes, thanks!

[1/1] scsi: storvsc: Fix error return in storvsc_probe()
      https://git.kernel.org/mkp/scsi/c/6112ff4e8f39

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-12-01  6:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27  3:02 [PATCH] scsi: storvsc: Fix error return in storvsc_probe() Jing Xiangfeng
2020-11-29 16:47 ` Michael Kelley
2020-12-01  6:06 ` 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).