]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: hwdrv_apci3200: properly validata the ai cmd->start_arg
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 17 Apr 2014 17:07:51 +0000 (10:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Apr 2014 17:21:30 +0000 (10:21 -0700)
commitdc26554fe6a1360d91306d97070ab925a5fbafcd
treea4c098d003b92ee1b2bcdd00ebcb560320a709bc
parent5d5765ab222dc8da13ab96d0bfa47ea837dba9df
staging: comedi: hwdrv_apci3200: properly validata the ai cmd->start_arg

The async command 'arguments' should be trivially validated in Step 3 of
the (*do_cmdtest) not Step 2b. Move the validataion in this driver to the
proper place.

This driver supports two cmd->start_src values, TRIG_NOW and TRIG_EXT.
TRIG_NOW sources should always have an arg of 0. The arg for TRIG_EXT
sources is driver specific.

Properly validate the cmd->start_arg based on the cmd->start_src. Remove
the noise when the arg is invalid and modify the cmd->start_arg so that
a valid value is returned to the user.

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_apci3200.c