Skip to contentSkip to conversation

scsi: qedi: fix error return code of qedi_alloc_global_queues()

PATCH Applied Jia-Ju Bai 3 participants 3 messages Mar 8, 2021 – Mar 25, 2021

Subsystems (2)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 scsi: qedi: fix error return code of qedi_alloc_global_queues()

When kzalloc() returns NULL to qedi->global_queues[i], no error return code of qedi_alloc_global_queues() is assigned.
To fix this bug, status is assigned with -ENOMEM in this case.

Fixes ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.")
---
 drivers/scsi/qedi/qedi_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/qedi/qedi_main.c +1 -0
index 47ad64b06623..69c5b5ee2169 100644
@@ -1675,6 +1675,7 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi)
 		if (!qedi->global_queues[i]) {
 			QEDI_ERR(&qedi->dbg_ctx,
 				 "Unable to allocation global queue %d.\n", i);
+			status = -ENOMEM;
 			goto mem_alloc_failure;
 		}
 
Signature · 1 line
2.17.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 42 lines

-----Original Message-----
From: Jia-Ju Bai <[email protected]>
Sent: Monday, March 8, 2021 9:00 AM
To: Nilesh Javali <[email protected]>; Manish Rangankar <[email protected]>; [email protected]; [email protected]
Cc: GR-QLogic-Storage-Upstream <GR-QLogic-Storage- [email protected]>; [email protected]; linux- [email protected]; Jia-Ju Bai <[email protected]>
Subject: [EXT] [PATCH] scsi: qedi: fix error return code of qedi_alloc_global_queues()

External Email

----------------------------------------------------------------------
When kzalloc() returns NULL to qedi->global_queues[i], no error return code of qedi_alloc_global_queues() is assigned.
To fix this bug, status is assigned with -ENOMEM in this case.

Fixes ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver

framework.")

---
 drivers/scsi/qedi/qedi_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/qedi/qedi_main.c index renamed from drivers/scsi/qedi/qedi_main.c +0 -0

47ad64b06623..69c5b5ee2169 100644

drivers/scsi/qedi/qedi_main.c +1 -1
@@ -1675,6 +1675,7 @@ static int qedi_alloc_global_queues(struct qedi_ctx
 *qedi)
 		if (!qedi->global_queues[i]) {
 			QEDI_ERR(&qedi->dbg_ctx,
 				 "Unable to allocation global queue %d.\n", i);
+			status = -ENOMEM;
 			goto mem_alloc_failure;
 		}
 
--
Quoted 1 line

2.17.1

Thanks,

#2 lore raw
In reply to Jia-Ju Bai
Quoted 3 lines · Jia-Ju Bai

When kzalloc() returns NULL to qedi->global_queues[i], no error return code of qedi_alloc_global_queues() is assigned.
To fix this bug, status is assigned with -ENOMEM in this case.

Applied to 5.12/scsi-fixes, thanks!

[1/1] scsi: qedi: fix error return code of qedi_alloc_global_queues()

      https://git.kernel.org/mkp/scsi/c/f69953837ca5
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering