From: H Hartley Sweeten Date: Tue, 30 Jul 2013 00:47:44 +0000 (-0700) Subject: staging: comedi: usbduxsigma: always clear the usb intfdata in (*detach) X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1da439008e972ad3dfceca8a9ff4950db20f3528;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: usbduxsigma: always clear the usb intfdata in (*detach) Make sure the usb intfdata is always cleared when the device is detached. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c index 636209458a66..60815a3ec540 100644 --- a/drivers/staging/comedi/drivers/usbduxsigma.c +++ b/drivers/staging/comedi/drivers/usbduxsigma.c @@ -1703,11 +1703,11 @@ static void usbduxsigma_detach(struct comedi_device *dev) struct usb_interface *intf = comedi_to_usb_interface(dev); struct usbduxsigma_private *devpriv = dev->private; + usb_set_intfdata(intf, NULL); + if (!devpriv) return; - usb_set_intfdata(intf, NULL); - down(&devpriv->sem); /* force unlink all urbs */