Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6971ed1f authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik
Browse files

[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: default avatarTejun Heo <htejun@gmail.com>
Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent ed621785
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -742,24 +742,18 @@ 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);
	}