summaryrefslogtreecommitdiff
path: root/drivers/ide/pci/aec62xx.c
diff options
context:
space:
mode:
authorAleksandar Radovanovic <biblbroks@sezampro.yu>2007-11-27 21:35:53 +0100
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-11-27 21:35:53 +0100
commitb48d08177fe635a549aaf63eef508be1de069ebf (patch)
tree2d116ba187f198c46b2083b3ef3bca2a3c5ab6d6 /drivers/ide/pci/aec62xx.c
parent8266105b15192177ac732ab8a27b315dc9291100 (diff)
aec62xx: Fix kernel oops in driver's probe function
Add pci_enable_device() to aec62xx probe function before doing any I/O. Original probe function tries to read from device's PCI region 4 before calling ide_setup_pci_device(). Since the device is not enabled at this point, on machines that have no firmware PCI initialization (e.g. ASUS WL-700gE router), corresponding PCI BAR is 0 and the following inb() causes a kernel oops. Signed-off-by: Aleksandar Radovanovic <biblbroks@sezampro.yu> Cc: Linus Torvalds <torvalds@linux-foundation.org>, Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/aec62xx.c')
-rw-r--r--drivers/ide/pci/aec62xx.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index 19ec421f7b9f..44268504ae43 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -260,6 +260,11 @@ static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_devi
{
struct ide_port_info d;
u8 idx = id->driver_data;
+ int err;
+
+ err = pci_enable_device(dev);
+ if (err)
+ return err;
d = aec62xx_chipsets[idx];
@@ -272,7 +277,11 @@ static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_devi
}
}
- return ide_setup_pci_device(dev, &d);
+ err = ide_setup_pci_device(dev, &d);
+ if (err)
+ pci_disable_device(dev);
+
+ return err;
}
static const struct pci_device_id aec62xx_pci_tbl[] = {