From: H Hartley Sweeten Date: Tue, 22 Mar 2016 18:10:40 +0000 (-0700) Subject: staging: comedi: ni_tio: make ni_gpct_device_destroy() NULL pointer safe X-Git-Tag: v4.14-rc1~3181^2~581 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bed05b6c3434e62310c2e37ef234f02ce57cf74d;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c index b74e44e..623fc6c 100644 --- a/drivers/staging/comedi/drivers/ni_tio.c +++ b/drivers/staging/comedi/drivers/ni_tio.c @@ -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);