mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 11:23:09 -04:00
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:
committed by
Greg Kroah-Hartman
parent
2460e3cd9f
commit
bed05b6c34
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user