[PATCH 2.6 IrDA] Fix nsc-ircc dongle_id input

From: Jean Tourrilhes
Date: Tue Oct 19 2004 - 20:37:05 EST


ir269_nsc_dongle-2.diff :
~~~~~~~~~~~~~~~~~~~~~~~
<Original patch from Maik Broemme>
o [CRITICA] Don't Oops on invalid dongle-id in nsc-ircc driver
Signed-off-by: Jean Tourrilhes <jt@xxxxxxxxxx>


diff -u -p linux/drivers/net/irda/nsc-ircc.d0.c linux/drivers/net/irda/nsc-ircc.c
--- linux/drivers/net/irda/nsc-ircc.d0.c Fri Oct 15 15:30:40 2004
+++ linux/drivers/net/irda/nsc-ircc.c Fri Oct 15 15:32:20 2004
@@ -351,8 +351,9 @@ static int __init nsc_ircc_open(int i, c
}
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,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/