staging: comedi: ni_660x: ni_gpct_device_destroy() can handle a NULL pointer
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 22 Mar 2016 18:10:41 +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_660x.c

index 35602cc7af61fc33c39d1f1344aa4ecdd4a2e8ac..2440cb6a72c7428735ed55879e98f03b161165d9 100644 (file)
@@ -1067,8 +1067,7 @@ static void ni_660x_detach(struct comedi_device *dev)
        if (dev->irq)
                free_irq(dev->irq, dev);
        if (devpriv) {
-               if (devpriv->counter_dev)
-                       ni_gpct_device_destroy(devpriv->counter_dev);
+               ni_gpct_device_destroy(devpriv->counter_dev);
                ni_660x_free_mite_rings(dev);
                mite_detach(devpriv->mite);
        }