diff options
author | Len Brown <len.brown@intel.com> | 2005-12-15 13:15:27 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-12-15 13:15:27 -0500 |
commit | 5b2db367a28c12e8dfd0b404d9ea35e948c5d7b3 (patch) | |
tree | 8ef2f739fc91acda0fb05797cb450b5789d79c59 /drivers/ide/pci/sgiioc4.c | |
parent | d3e4cefc86ce1aefc0e9aebdc56308cb4bd51997 (diff) | |
parent | 7116317dc9148d783846299fc80a7d377baa6dca (diff) |
Auto-update from upstream
Diffstat (limited to 'drivers/ide/pci/sgiioc4.c')
-rw-r--r-- | drivers/ide/pci/sgiioc4.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index af526b671c4..4ee597d0879 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c @@ -622,12 +622,18 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d) ide_hwif_t *hwif; int h; + /* + * Find an empty HWIF; if none available, return -ENOMEM. + */ for (h = 0; h < MAX_HWIFS; ++h) { hwif = &ide_hwifs[h]; - /* Find an empty HWIF */ if (hwif->chipset == ide_unknown) break; } + if (h == MAX_HWIFS) { + printk(KERN_ERR "%s: too many IDE interfaces, no room in table\n", d->name); + return -ENOMEM; + } /* Get the CmdBlk and CtrlBlk Base Registers */ base = pci_resource_start(dev, 0) + IOC4_CMD_OFFSET; |