scsi: hpsa: free irq on q indexed by h->intr_mode and not i
authorColin Ian King <colin.king@canonical.com>
Mon, 14 Nov 2016 12:59:35 +0000 (12:59 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 14 Nov 2016 23:35:48 +0000 (18:35 -0500)
Use correct index on q, use h->intr_mode instead of i. Issue detected
using static analysis with cppcheck

Fixes: bc2bb1543e62a5d0 ("scsi: hpsa: use pci_alloc_irq_vectors and automatic irq affinity")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hpsa.c

index 9459925566f22c2f3c32d61ead14dbdaa5bb4c60..0d4f21c95a408c9810af54533c9ca5c1f8239b06 100644 (file)
@@ -8220,7 +8220,7 @@ static void hpsa_free_irqs(struct ctlr_info *h)
 
        if (!h->msix_vectors || h->intr_mode != PERF_MODE_INT) {
                /* Single reply queue, only one irq to free */
-               free_irq(pci_irq_vector(h->pdev, 0), &h->q[i]);
+               free_irq(pci_irq_vector(h->pdev, 0), &h->q[h->intr_mode]);
                h->q[h->intr_mode] = 0;
                return;
        }