usb: mdm_bridge: Remove platform device before freeing structure

This gives platform drivers a chance to do proper cleanup, especially
if they call ctrl_bridge_close which needs to access several of the
structure's members.

Change-Id: I56f36ff105ec131e560ea8a436a89316f6f88974
Signed-off-by: Jack Pham <jackp@codeaurora.org>
diff --git a/drivers/usb/misc/mdm_ctrl_bridge.c b/drivers/usb/misc/mdm_ctrl_bridge.c
index 0397428..11d388c 100644
--- a/drivers/usb/misc/mdm_ctrl_bridge.c
+++ b/drivers/usb/misc/mdm_ctrl_bridge.c
@@ -697,6 +697,8 @@
 
 	dev_dbg(&dev->udev->dev, "%s:\n", __func__);
 
+	platform_device_del(dev->pdev);
+
 	kfree(dev->in_ctlreq);
 	kfree(dev->readbuf);
 	kfree(dev->intbuf);
@@ -704,7 +706,6 @@
 	usb_free_urb(dev->readurb);
 	usb_free_urb(dev->inturb);
 
-	platform_device_del(dev->pdev);
 	__dev[id] = NULL;
 	ch_id--;