From: Tejun Heo <htejun@gmail.com>
To: Adrian Bunk <bunk@stusta.de>
Cc: jgarzik@pobox.com, linux-ide@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] ahci: fix NULL pointer dereference detected by Coverity
Date: Sat, 11 Mar 2006 12:47:54 +0900 [thread overview]
Message-ID: <20060311034754.GA31198@htj.dyndns.org> (raw)
In-Reply-To: <20060310193414.GT21864@stusta.de>
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>
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -778,23 +778,17 @@ static irqreturn_t ahci_interrupt (int i
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);
next prev parent reply other threads:[~2006-03-11 3:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-10 19:34 drivers/scsi/ahci.c:ahci_interrupt(): NULL pointer dereference Adrian Bunk
2006-03-11 3:47 ` Tejun Heo [this message]
2006-03-12 0:10 ` [PATCH] ahci: fix NULL pointer dereference detected by Coverity Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060311034754.GA31198@htj.dyndns.org \
--to=htejun@gmail.com \
--cc=bunk@stusta.de \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®