qla2x00t-32gbit: Free interrupts if response queue allocation failed

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8173 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-04-08 02:20:11 +00:00
parent 0dc7776980
commit e4e13e917a

View File

@@ -3451,28 +3451,6 @@ static const struct qla_init_msix_entry qla82xx_msix_entries[] = {
{ "qla2xxx (rsp_q)", qla82xx_msix_rsp_q },
};
#if !HAVE_PCI_IRQ_VECTOR
static void
qla24xx_disable_msix(struct qla_hw_data *ha)
{
int i;
struct qla_msix_entry *qentry;
scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
for (i = 0; i < ha->msix_count; i++) {
qentry = &ha->msix_entries[i];
if (qentry->have_irq)
free_irq(qentry->vector, qentry->handle);
}
pci_disable_msix(ha->pdev);
kfree(ha->msix_entries);
ha->msix_entries = NULL;
ha->flags.msix_enabled = 0;
ql_dbg(ql_dbg_init, vha, 0x0042,
"Disabled the MSI.\n");
}
#endif
static int
qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
{
@@ -3808,7 +3786,6 @@ qla2x00_free_irqs(scsi_qla_host_t *vha)
goto free_irqs;
rsp = ha->rsp_q_map[0];
#if HAVE_PCI_IRQ_VECTOR
if (ha->flags.msix_enabled) {
struct qla_msix_entry *qentry;
int i;
@@ -3817,7 +3794,12 @@ qla2x00_free_irqs(scsi_qla_host_t *vha)
qentry = &ha->msix_entries[i];
if (qentry->have_irq) {
irq_set_affinity_notifier(qentry->vector, NULL);
free_irq(pci_irq_vector(ha->pdev, i), qentry->handle);
#if HAVE_PCI_IRQ_VECTOR
free_irq(pci_irq_vector(ha->pdev, i),
qentry->handle);
#else
free_irq(qentry->vector, qentry->handle);
#endif
}
}
kfree(ha->msix_entries);
@@ -3825,22 +3807,21 @@ qla2x00_free_irqs(scsi_qla_host_t *vha)
ha->flags.msix_enabled = 0;
ql_dbg(ql_dbg_init, vha, 0x0042,
"Disabled MSI-X.\n");
#if HAVE_PCI_IRQ_VECTOR
} else {
free_irq(pci_irq_vector(ha->pdev, 0), rsp);
}
#else
if (ha->flags.msix_enabled)
qla24xx_disable_msix(ha);
else if (ha->flags.msi_enabled) {
} else if (ha->flags.msi_enabled) {
free_irq(ha->pdev->irq, rsp);
pci_disable_msi(ha->pdev);
} else
} else {
free_irq(ha->pdev->irq, rsp);
#endif
}
free_irqs:
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
;
pci_disable_msix(ha->pdev);
#else
pci_free_irq_vectors(ha->pdev);
#endif