Skip to content

Commit

Permalink
scsi: qla2xxx: Fix a qla24xx_enable_msix() error path
Browse files Browse the repository at this point in the history
[ Upstream commit 24afabdbd0b3553963a2bbf465895492b14d1107 ]

Make sure that the allocated interrupts are freed if allocating memory for
the msix_entries array fails.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
bvanassche authored and gregkh committed May 31, 2019
1 parent f52536d commit 7aed8ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/scsi/qla2xxx/qla_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3395,7 +3395,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
ql_log(ql_log_fatal, vha, 0x00c8,
"Failed to allocate memory for ha->msix_entries.\n");
ret = -ENOMEM;
goto msix_out;
goto free_irqs;
}
ha->flags.msix_enabled = 1;

Expand Down Expand Up @@ -3477,6 +3477,10 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)

msix_out:
return ret;

free_irqs:
pci_free_irq_vectors(ha->pdev);
goto msix_out;
}

int
Expand Down

0 comments on commit 7aed8ee

Please sign in to comment.