staging: comedi: rtd520: remove unnecessary interrupt disable
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 20 Feb 2015 19:52:28 +0000 (12:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Mar 2015 02:47:39 +0000 (18:47 -0800)
The read/write of the PLX_INTRCS_REG during the driver detach is not
necessary. The rtd_reset() function writes 0 to this register which
will disable all interrupts.

This also fixes a dereference after null check reported by coverity.

Reported-by: coverity (CID 751066)
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/rtd520.c

index a7255d13775a4876fe3e8c60803e48cf189bedec..2688af7f3405ab5af71965d4a3827aca36200086 100644 (file)
@@ -1299,12 +1299,8 @@ static void rtd_detach(struct comedi_device *dev)
                /* Shut down any board ops by resetting it */
                if (dev->mmio && devpriv->lcfg)
                        rtd_reset(dev);
-               if (dev->irq) {
-                       writel(readl(devpriv->lcfg + PLX_INTRCS_REG) &
-                               ~(ICS_PLIE | ICS_DMA0_E | ICS_DMA1_E),
-                               devpriv->lcfg + PLX_INTRCS_REG);
+               if (dev->irq)
                        free_irq(dev->irq, dev);
-               }
                if (dev->mmio)
                        iounmap(dev->mmio);
                if (devpriv->las1)