staging: comedi: me4000: validate the cmd->start_arg
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 17 Apr 2014 17:08:01 +0000 (10:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Apr 2014 17:21:31 +0000 (10:21 -0700)
The cmd->start_arg should be trivially validated in Step 3 of the
(*do_cmdtest) functions. Add the necessary code.

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/me4000.c

index e146555..f43221f 100644 (file)
@@ -918,6 +918,8 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
 
        /* Step 3: check if arguments are trivially valid */
 
+       err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
+
        if (cmd->chanlist_len < 1) {
                cmd->chanlist_len = 1;
                err |= -EINVAL;