OSDN Git Service

scsi: lpfc: Fix error code if kcalloc() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 11 Feb 2019 18:43:00 +0000 (21:43 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 13 Feb 2019 03:15:54 +0000 (22:15 -0500)
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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_init.c

index d24af07..eef6b92 100644 (file)
@@ -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);