From 025b918731e4ee46ee8a27073281b2db715f79e2 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Thu, 17 Apr 2014 10:08:01 -0700 Subject: [PATCH] staging: comedi: me4000: 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 --- drivers/staging/comedi/drivers/me4000.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c index e1465559756f..f43221fcd15e 100644 --- a/drivers/staging/comedi/drivers/me4000.c +++ b/drivers/staging/comedi/drivers/me4000.c @@ -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; -- 2.30.2