diff options
author | Dan Carpenter <error27@gmail.com> | 2010-05-07 04:30:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-21 12:34:30 -0400 |
commit | 26e1e8d1d1cfa914b95b5dab001a6ed898872755 (patch) | |
tree | c095b4c89c879f604c5cd9ba2f5968810bd1715a | |
parent | e114474cf5c7fe7ab94dd4f5938ffa51c9af77c4 (diff) |
serial: isicomm: handle running out of slots
This patch makes it return -ENODEV if we run out of empty slots in the
probe function. It's unlikely to happen, but it makes the static
checkers happy.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/char/isicom.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index c1ab303455cf..98310e1aae30 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c | |||
@@ -1573,11 +1573,16 @@ static int __devinit isicom_probe(struct pci_dev *pdev, | |||
1573 | dev_info(&pdev->dev, "ISI PCI Card(Device ID 0x%x)\n", ent->device); | 1573 | dev_info(&pdev->dev, "ISI PCI Card(Device ID 0x%x)\n", ent->device); |
1574 | 1574 | ||
1575 | /* allot the first empty slot in the array */ | 1575 | /* allot the first empty slot in the array */ |
1576 | for (index = 0; index < BOARD_COUNT; index++) | 1576 | for (index = 0; index < BOARD_COUNT; index++) { |
1577 | if (isi_card[index].base == 0) { | 1577 | if (isi_card[index].base == 0) { |
1578 | board = &isi_card[index]; | 1578 | board = &isi_card[index]; |
1579 | break; | 1579 | break; |
1580 | } | 1580 | } |
1581 | } | ||
1582 | if (index == BOARD_COUNT) { | ||
1583 | retval = -ENODEV; | ||
1584 | goto err_disable; | ||
1585 | } | ||
1581 | 1586 | ||
1582 | board->index = index; | 1587 | board->index = index; |
1583 | board->base = pci_resource_start(pdev, 3); | 1588 | board->base = pci_resource_start(pdev, 3); |
@@ -1624,6 +1629,7 @@ errunrr: | |||
1624 | errdec: | 1629 | errdec: |
1625 | board->base = 0; | 1630 | board->base = 0; |
1626 | card_count--; | 1631 | card_count--; |
1632 | err_disable: | ||
1627 | pci_disable_device(pdev); | 1633 | pci_disable_device(pdev); |
1628 | err: | 1634 | err: |
1629 | return retval; | 1635 | return retval; |