Commit a5519a26 authored by Prarit Bhargava's avatar Prarit Bhargava Committed by Bartlomiej Zolnierkiewicz

[ide] fix error handling in probe_hwif_init() and sgiioc4 driver

From: Prarit Bhargava <prarit@sgi.com>

I discovered an issue where a hwif_init() failure lead to /proc/ide files
being created for devices that failed probes.  This resulted in
oops/WARN_ON/BUG_ON executions through the kernel depending on what
actions were on going.

slightly changed by me (bart)
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 8a5e2be9
......@@ -841,7 +841,11 @@ int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)
if (fixup)
fixup(hwif);
hwif_init(hwif);
if (!hwif_init(hwif)) {
printk(KERN_INFO "%s: failed to initialize IDE interface\n",
hwif->name);
return -1;
}
if (hwif->present) {
u16 unit = 0;
......
......@@ -669,7 +669,8 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d)
printk(KERN_INFO "%s: %s Bus-Master DMA disabled\n",
hwif->name, d->name);
probe_hwif_init(hwif);
if (probe_hwif_init(hwif))
return -EIO;
/* Create /proc/ide entries */
create_proc_ide_interfaces();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment