]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: drivers: core validates chanlist_len max
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 17 Apr 2014 17:07:46 +0000 (10:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Apr 2014 17:21:29 +0000 (10:21 -0700)
commit9402e3ab8bb88972b7b787cab995541e9cf2d1e0
tree3f6534fab742cd167791f29dfc0d5776b54b0b08
parent4d1049c3925b67e0fd0f65b2157e69de08c22281
staging: comedi: drivers: core validates chanlist_len max

The comedi core checks if the (cmd->chanlist_len > s->len_chanlist) when the
comedi_cmd is copied from user to kernel space by __comedi_get_user_cmd().
If so, the core returns -EINVAL and will not call the subdevice (*do_cmdtest)
and (*do_cmd).

Remove the unnecessary "max" checks in the comedi driver (*do_cmdtest) and
helper functions.

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/addi-data/hwdrv_apci3120.c
drivers/staging/comedi/drivers/adl_pci9118.c
drivers/staging/comedi/drivers/pcl812.c
drivers/staging/comedi/drivers/rtd520.c