summaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/ali-ircc.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@sparkweed.localdomain>2006-09-24 04:03:52 +0200
committerJames Bottomley <jejb@sparkweed.localdomain>2006-09-24 04:03:52 +0200
commit1aedf2ccc60fade26c46fae12e28664d0da3f199 (patch)
treed91083e3079f1ddb942a382ac2b5a7525570ad59 /drivers/net/irda/ali-ircc.c
parent[SCSI] SPI transport class: misc DV fixes (diff)
parentMerge git://git.infradead.org/mtd-2.6 (diff)
downloadlinux-1aedf2ccc60fade26c46fae12e28664d0da3f199.tar.xz
linux-1aedf2ccc60fade26c46fae12e28664d0da3f199.zip
Merge mulgrave-w:git/linux-2.6
Conflicts: include/linux/blkdev.h Trivial merge to incorporate tag prototypes.
Diffstat (limited to 'drivers/net/irda/ali-ircc.c')
-rw-r--r--drivers/net/irda/ali-ircc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index e3c8cd5eca67..68d4c418cb98 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -249,7 +249,7 @@ static void __exit ali_ircc_cleanup(void)
IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
- for (i=0; i < 4; i++) {
+ for (i=0; i < ARRAY_SIZE(dev_self); i++) {
if (dev_self[i])
ali_ircc_close(dev_self[i]);
}
@@ -273,6 +273,12 @@ static int ali_ircc_open(int i, chipio_t *info)
int err;
IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
+
+ if (i >= ARRAY_SIZE(dev_self)) {
+ IRDA_ERROR("%s(), maximum number of supported chips reached!\n",
+ __FUNCTION__);
+ return -ENOMEM;
+ }
/* Set FIR FIFO and DMA Threshold */
if ((ali_ircc_setup(info)) == -1)