upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / drivers / net / irda / nsc-ircc.c
index c1e79f5..480454f 100644 (file)
@@ -351,8 +351,9 @@ static int __init nsc_ircc_open(int i, chipio_t *info)
        }
        MESSAGE("IrDA: Registered device %s\n", dev->name);
 
-       /* Check if user has supplied the dongle id or not */
-       if (!dongle_id) {
+       /* Check if user has supplied a valid dongle id or not */
+       if ((dongle_id <= 0) ||
+           (dongle_id >= (sizeof(dongle_types) / sizeof(dongle_types[0]))) ) {
                dongle_id = nsc_ircc_read_dongle_id(self->io.fir_base);
                
                MESSAGE("%s, Found dongle: %s\n", driver_name,