diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2013-04-04 13:58:42 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-05 21:33:16 (GMT) |
commit | f08e0ac59a93db2d8abc7000e2647164104524c6 (patch) | |
tree | c240825d91b7e0cbf9db4b57d047a519e971416e /drivers/staging/comedi/drivers.c | |
parent | 7e1389a9e622a421e85e8611c76bd9142bf4bff1 (diff) | |
download | linux-fsl-qoriq-f08e0ac59a93db2d8abc7000e2647164104524c6.tar.xz |
staging: comedi: check comedi_auto_config() params
Do some minimal error checking of the parameters of
`comedi_auto_config()`. Just make sure the `hardware_device` and
`driver` parameters are non-NULL.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers.c')
-rw-r--r-- | drivers/staging/comedi/drivers.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index 4724f27..4460814 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c @@ -410,6 +410,16 @@ int comedi_auto_config(struct device *hardware_device, struct comedi_device *comedi_dev; int ret; + if (!hardware_device) { + pr_warn("BUG! comedi_auto_config called with NULL hardware_device\n"); + return -EINVAL; + } + if (!driver) { + dev_warn(hardware_device, + "BUG! comedi_auto_config called with NULL comedi driver\n"); + return -EINVAL; + } + if (!driver->auto_attach) { dev_warn(hardware_device, "BUG! comedi driver '%s' has no auto_attach handler\n", |