Skip to content

Commit

Permalink
[PATCH] ahci: fix NULL pointer dereference detected by Coverity
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Mar 12, 2006
1 parent ed62178 commit 6971ed1
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions drivers/scsi/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,23 +742,17 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
struct ata_queued_cmd *qc;
qc = ata_qc_from_tag(ap, ap->active_tag);
if (!ahci_host_intr(ap, qc))
if (ata_ratelimit()) {
struct pci_dev *pdev =
to_pci_dev(ap->host_set->dev);
dev_printk(KERN_WARNING, &pdev->dev,
if (ata_ratelimit())
dev_printk(KERN_WARNING, host_set->dev,
"unhandled interrupt on port %u\n",
i);
}

VPRINTK("port %u\n", i);
} else {
VPRINTK("port %u (no irq)\n", i);
if (ata_ratelimit()) {
struct pci_dev *pdev =
to_pci_dev(ap->host_set->dev);
dev_printk(KERN_WARNING, &pdev->dev,
if (ata_ratelimit())
dev_printk(KERN_WARNING, host_set->dev,
"interrupt on disabled port %u\n", i);
}
}

irq_ack |= (1 << i);
Expand Down

0 comments on commit 6971ed1

Please sign in to comment.