aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-03-10 22:47:54 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-11 19:06:02 -0500
commit6971ed1fbbc80cae54e082aae153d5b063885d0a (patch)
tree164d950b587badb59dc2e2415ab74c2210accff7 /drivers/scsi
parented62178589929d248a0aaf4018ca3867e2f96d9d (diff)
[PATCH] ahci: fix NULL pointer dereference detected by Coverity
Fix NULL pointer dereference detected by the Coverity checker. Kill dev -> pdev -> dev conversion while at it. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Adrian Bunk <bunk@stusta.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ahci.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index a800fb51168b..559ff7aae3f1 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -742,23 +742,17 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
742 struct ata_queued_cmd *qc; 742 struct ata_queued_cmd *qc;
743 qc = ata_qc_from_tag(ap, ap->active_tag); 743 qc = ata_qc_from_tag(ap, ap->active_tag);
744 if (!ahci_host_intr(ap, qc)) 744 if (!ahci_host_intr(ap, qc))
745 if (ata_ratelimit()) { 745 if (ata_ratelimit())
746 struct pci_dev *pdev = 746 dev_printk(KERN_WARNING, host_set->dev,
747 to_pci_dev(ap->host_set->dev);
748 dev_printk(KERN_WARNING, &pdev->dev,
749 "unhandled interrupt on port %u\n", 747 "unhandled interrupt on port %u\n",
750 i); 748 i);
751 }
752 749
753 VPRINTK("port %u\n", i); 750 VPRINTK("port %u\n", i);
754 } else { 751 } else {
755 VPRINTK("port %u (no irq)\n", i); 752 VPRINTK("port %u (no irq)\n", i);
756 if (ata_ratelimit()) { 753 if (ata_ratelimit())
757 struct pci_dev *pdev = 754 dev_printk(KERN_WARNING, host_set->dev,
758 to_pci_dev(ap->host_set->dev);
759 dev_printk(KERN_WARNING, &pdev->dev,
760 "interrupt on disabled port %u\n", i); 755 "interrupt on disabled port %u\n", i);
761 }
762 } 756 }
763 757
764 irq_ack |= (1 << i); 758 irq_ack |= (1 << i);