From: H Hartley Sweeten Date: Thu, 17 Apr 2014 17:08:00 +0000 (-0700) Subject: staging: comedi: gsc_hpdi: validate the cmd->start_arg X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4264cb64069e1c746483938c09e0df1099befd8b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: gsc_hpdi: validate the cmd->start_arg 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c index bae4e9709135..22333c1ad88c 100644 --- a/drivers/staging/comedi/drivers/gsc_hpdi.c +++ b/drivers/staging/comedi/drivers/gsc_hpdi.c @@ -410,6 +410,8 @@ static int gsc_hpdi_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 || !cmd->chanlist) { cmd->chanlist_len = 32; err |= -EINVAL;