staging: comedi: ni_mio_common: ni_gpct_device_destroy() can handle a NULL pointer
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 22 Mar 2016 18:10:42 +0000 (11:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
Remove the unnecessary NULL pointer check.

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>
drivers/staging/comedi/drivers/ni_mio_common.c

index dcaf7e89f299efc20ee61893486e0c19f997e019..71c8fd2cfff698fe3803ef20e05c36ef559504b1 100644 (file)
@@ -5675,8 +5675,6 @@ static void mio_common_detach(struct comedi_device *dev)
 {
        struct ni_private *devpriv = dev->private;
 
-       if (devpriv) {
-               if (devpriv->counter_dev)
-                       ni_gpct_device_destroy(devpriv->counter_dev);
-       }
+       if (devpriv)
+               ni_gpct_device_destroy(devpriv->counter_dev);
 }