staging: comedi: ni_tio: make ni_gpct_device_destroy() NULL pointer safe

Modify the pointer check to make this function NULL pointer safe.

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>
This commit is contained in:
H Hartley Sweeten
2016-03-22 11:10:40 -07:00
committed by Greg Kroah-Hartman
parent 2460e3cd9f
commit bed05b6c34

View File

@@ -1413,7 +1413,7 @@ EXPORT_SYMBOL_GPL(ni_gpct_device_construct);
void ni_gpct_device_destroy(struct ni_gpct_device *counter_dev)
{
if (!counter_dev->counters)
if (!counter_dev)
return;
kfree(counter_dev->counters);
kfree(counter_dev);