]> git.karo-electronics.de Git - karo-tx-linux.git/commit
staging: comedi: drivers: properly validate cmd->scan_end_arg
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 17 Apr 2014 17:07:47 +0000 (10:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Apr 2014 17:21:29 +0000 (10:21 -0700)
commitf50cebb9baa5fd0e561f436bd53ffa35df16edb2
tree59019c560c76f2d7496bfc18f36b1ba82e56cb1a
parent860b7c398a744c1eef42a59b661e870aca12d9be
staging: comedi: drivers: properly validate cmd->scan_end_arg

When the async command 'scan_end_src' is TRIG_COUNT the 'scan_end_arg'
is the cmd->chanlist_len. Fix a couple open-coded drivers. Add the
check to the drivers that do not validate this command argument.

The core validates that the cmd->chanlist_len is <= s->len_chanlist.
During the post config after the attach the core also make sure that
the s->len_chanlist is initialized. For clarity, initialize the
s->len_chanlist in a couple drivers that are relying on the core to
initialize it to '1'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/8255.c
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c
drivers/staging/comedi/drivers/addi_apci_1032.c
drivers/staging/comedi/drivers/amplc_pc236.c
drivers/staging/comedi/drivers/comedi_parport.c
drivers/staging/comedi/drivers/dt282x.c
drivers/staging/comedi/drivers/ni_6527.c
drivers/staging/comedi/drivers/ni_65xx.c
drivers/staging/comedi/drivers/pcl726.c
drivers/staging/comedi/drivers/rtd520.c