* [052/165] cmd640: fix kernel oops in test_irq() method
@ 2010-07-30 17:14 Greg KH
0 siblings, 0 replies; only message in thread
From: Greg KH @ 2010-07-30 17:14 UTC (permalink / raw)
To: linux-kernel, stable
Cc: stable-review, torvalds, akpm, alan, Sergei Shtylyov,
David S. Miller
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
commit a9ddabc52ce3757a4331d6c1e8bf4065333cc51b upstream.
When implementing the test_iqr() method, I forgot that this driver is not an
ordinary PCI driver and also needs to support VLB variant of the chip. Moreover,
'hwif->dev' should be NULL, potentially causing oops in pci_read_config_byte().
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/ide/cmd640.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/drivers/ide/cmd640.c
+++ b/drivers/ide/cmd640.c
@@ -632,12 +632,10 @@ static void cmd640_init_dev(ide_drive_t
static int cmd640_test_irq(ide_hwif_t *hwif)
{
- struct pci_dev *dev = to_pci_dev(hwif->dev);
int irq_reg = hwif->channel ? ARTTIM23 : CFR;
- u8 irq_stat, irq_mask = hwif->channel ? ARTTIM23_IDE23INTR :
+ u8 irq_mask = hwif->channel ? ARTTIM23_IDE23INTR :
CFR_IDE01INTR;
-
- pci_read_config_byte(dev, irq_reg, &irq_stat);
+ u8 irq_stat = get_cmd640_reg(irq_reg);
return (irq_stat & irq_mask) ? 1 : 0;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-30 17:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-30 17:14 [052/165] cmd640: fix kernel oops in test_irq() method Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox