linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails
@ 2021-10-18  1:56 Zheyu Ma
  2021-10-18 14:20 ` Himanshu Madhani
  2021-10-19  3:43 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Zheyu Ma @ 2021-10-18  1:56 UTC (permalink / raw)
  To: njavali, GR-QLogic-Storage-Upstream, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, Zheyu Ma

During the process of driver probing, probe function should return < 0
for failure, otherwise kernel will treat value > 0 as success.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
 drivers/scsi/qla2xxx/qla_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index d2e40aaba734..836fedcea241 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4157,7 +4157,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
 					ql_dbg_pci(ql_dbg_init, ha->pdev,
 					    0xe0ee, "%s: failed alloc dsd\n",
 					    __func__);
-					return 1;
+					return -ENOMEM;
 				}
 				ha->dif_bundle_kallocs++;
 
-- 
2.17.6


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

* Re: [PATCH] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails
  2021-10-18  1:56 [PATCH] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails Zheyu Ma
@ 2021-10-18 14:20 ` Himanshu Madhani
  2021-10-19  3:43 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Himanshu Madhani @ 2021-10-18 14:20 UTC (permalink / raw)
  To: Zheyu Ma
  Cc: Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin Petersen, linux-scsi,
	linux-kernel



> On Oct 17, 2021, at 8:56 PM, Zheyu Ma <zheyuma97@gmail.com> wrote:
> 
> During the process of driver probing, probe function should return < 0
> for failure, otherwise kernel will treat value > 0 as success.
> 
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
> ---
> drivers/scsi/qla2xxx/qla_os.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index d2e40aaba734..836fedcea241 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -4157,7 +4157,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
> 					ql_dbg_pci(ql_dbg_init, ha->pdev,
> 					    0xe0ee, "%s: failed alloc dsd\n",
> 					    __func__);
> -					return 1;
> +					return -ENOMEM;
> 				}
> 				ha->dif_bundle_kallocs++;
> 
> -- 
> 2.17.6
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering


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

* Re: [PATCH] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails
  2021-10-18  1:56 [PATCH] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails Zheyu Ma
  2021-10-18 14:20 ` Himanshu Madhani
@ 2021-10-19  3:43 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-10-19  3:43 UTC (permalink / raw)
  To: Zheyu Ma, jejb, njavali, GR-QLogic-Storage-Upstream
  Cc: Martin K . Petersen, linux-kernel, linux-scsi

On Mon, 18 Oct 2021 01:56:21 +0000, Zheyu Ma wrote:

> During the process of driver probing, probe function should return < 0
> for failure, otherwise kernel will treat value > 0 as success.
> 
> 

Applied to 5.15/scsi-fixes, thanks!

[1/1] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails
      https://git.kernel.org/mkp/scsi/c/06634d5b6e92

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2021-10-19  3:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18  1:56 [PATCH] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails Zheyu Ma
2021-10-18 14:20 ` Himanshu Madhani
2021-10-19  3:43 ` 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).