Skip to contentSkip to conversation

scsi: lpfc: Fix error code if kcalloc() fails

PATCH Applied Dan Carpenter 3 participants 3 messages Feb 11, 2019 – Feb 13, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: lpfc: Fix error code if kcalloc() fails

This should return -ENOMEM if kcalloc() fails, but it accidentally returns success instead.

Fixes 6a828b0f6192 ("scsi: lpfc: Support non-uniform allocation of MSIX vectors to hardware queues")
---
 drivers/scsi/lpfc/lpfc_init.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/lpfc/lpfc_init.c +1 -0
index 900edae7ccc4..aa801d2f36e5 100644
@@ -9638,6 +9638,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba)
 			lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 					"0549 Failed setup of CQ Lookup table: "
 					"size 0x%x\n", phba->sli4_hba.cq_max);
+			rc = -ENOMEM;
 			goto out_destroy;
 		}
 		lpfc_setup_cq_lookup(phba);
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Dan Carpenter

This should return -ENOMEM if kcalloc() fails, but it accidentally returns success instead.

Fixes 6a828b0f6192 ("scsi: lpfc: Support non-uniform allocation of MSIX vectors to hardware queues")
---
 drivers/scsi/lpfc/lpfc_init.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/lpfc/lpfc_init.c +0 -0
index 900edae7ccc4..aa801d2f36e5 100644

drivers/scsi/lpfc/lpfc_init.c lpfc_sli4_queue_setup(struct lpfc_hba *phba) · line 9644

Quoted 7 lines
drivers/scsi/lpfc/lpfc_init.c +1 -0
@@ -9638,6 +9638,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba)
 			lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 					"0549 Failed setup of CQ Lookup table: "
 					"size 0x%x\n", phba->sli4_hba.cq_max);
+			rc = -ENOMEM;
 			goto out_destroy;
 		}
 		lpfc_setup_cq_lookup(phba);
#2 lore raw
In reply to Dan Carpenter

Dan,

Quoted 2 lines

This should return -ENOMEM if kcalloc() fails, but it accidentally returns success instead.

Applied to 5.1/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering