usb : gadget : fsl: fix the fault issue on rmmod
authorSuresh Gupta <suresh.gupta@freescale.com>
Wed, 2 Apr 2014 16:56:46 +0000 (22:26 +0530)
committerFelipe Balbi <balbi@ti.com>
Wed, 16 Apr 2014 15:11:46 +0000 (10:11 -0500)
completion in udc_controller->done should be assign with proper
value before complete called. The complete called in fsl_udc_release
which intern called from usb_del_gadget_udc, so moving assignment
before calling usb_del_gadget_udc

Signed-off-by: Suresh Gupta <suresh.gupta@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/fsl_udc_core.c

index 15960af0f67ea7805e22e9fea6671c2635e16153..dcd0b07ae3a02035ecf8fbd1550bcc3ac5f0ba8b 100644 (file)
@@ -2532,8 +2532,8 @@ static int __exit fsl_udc_remove(struct platform_device *pdev)
        if (!udc_controller)
                return -ENODEV;
 
-       usb_del_gadget_udc(&udc_controller->gadget);
        udc_controller->done = &done;
+       usb_del_gadget_udc(&udc_controller->gadget);
 
        fsl_udc_clk_release();