aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/via-ircc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/irda/via-ircc.c')
-rw-r--r--drivers/net/irda/via-ircc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 8bafb455c102..79b85f327500 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -279,7 +279,7 @@ static void via_ircc_clean(void)
279 279
280 IRDA_DEBUG(3, "%s()\n", __FUNCTION__); 280 IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
281 281
282 for (i=0; i < 4; i++) { 282 for (i=0; i < ARRAY_SIZE(dev_self); i++) {
283 if (dev_self[i]) 283 if (dev_self[i])
284 via_ircc_close(dev_self[i]); 284 via_ircc_close(dev_self[i]);
285 } 285 }
@@ -327,6 +327,9 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
327 327
328 IRDA_DEBUG(3, "%s()\n", __FUNCTION__); 328 IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
329 329
330 if (i >= ARRAY_SIZE(dev_self))
331 return -ENOMEM;
332
330 /* Allocate new instance of the driver */ 333 /* Allocate new instance of the driver */
331 dev = alloc_irdadev(sizeof(struct via_ircc_cb)); 334 dev = alloc_irdadev(sizeof(struct via_ircc_cb));
332 if (dev == NULL) 335 if (dev == NULL)