Commit 1df11651 authored by Jean Tourrilhes's avatar Jean Tourrilhes Committed by David S. Miller

[IRDA]: Fix nsc-ircc dongle_id input

<Original patch from Maik Broemme>

o [CRITICA] Don't Oops on invalid dongle-id in nsc-ircc driver
Signed-off-by: default avatarJean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 82f50c79
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment