Skip to content

Commit a9ddabc

Browse files
Sergei Shtylyovdavem330
authored andcommitted
cmd640: fix kernel oops in test_irq() method
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f693be4 commit a9ddabc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/ide/cmd640.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,10 @@ static void __init cmd640_init_dev(ide_drive_t *drive)
633633

634634
static int cmd640_test_irq(ide_hwif_t *hwif)
635635
{
636-
struct pci_dev *dev = to_pci_dev(hwif->dev);
637636
int irq_reg = hwif->channel ? ARTTIM23 : CFR;
638-
u8 irq_stat, irq_mask = hwif->channel ? ARTTIM23_IDE23INTR :
637+
u8 irq_mask = hwif->channel ? ARTTIM23_IDE23INTR :
639638
CFR_IDE01INTR;
640-
641-
pci_read_config_byte(dev, irq_reg, &irq_stat);
639+
u8 irq_stat = get_cmd640_reg(irq_reg);
642640

643641
return (irq_stat & irq_mask) ? 1 : 0;
644642
}

0 commit comments

Comments
 (0)