summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorPeter Oh <poh@broadcom.com>2013-09-12 01:42:18 +0000
committerColin Cross <ccross@android.com>2014-03-19 13:10:28 -0700
commite70246a62be37ca90dd65b6bbafc8cf7d4e5dac9 (patch)
treec869053ccead431aa749605145d7344662363dc0 /drivers/usb/gadget
parenta79ae42ee77d005c244a2d2882b7da847748b099 (diff)
USB: remove duplicate out endpoint creation in MTP mode
Android MTP gadget uses 3 endpoints which are 1 in endpoint, 1 out endpoint, and 1 interrupt endpoint. However when MTP gadget creates its endpoints, it creates the out endpoint twice and overwrites the first created out endpoint with the second one, so that it causes a leak of endpoint resources. Change-Id: Iba82950095610b26b362f4b10a67cedfb1fee366 Signed-off-by: Peter Oh <poh@broadcom.com> Reviewed-on: http://mps-gerrit.broadcom.com/37744 Reviewed-by: Graham Williams <gwilli@broadcom.com> Reviewed-by: John Garry <jgarry@broadcom.com> Branch-Open: Branch Status <branch_status_noreply@broadcom.com> Reviewed-by: Checkpatch Status <checkpatch_status_noreply@broadcom.com> Reviewed-by: Joyjit Nath <joyjit@broadcom.com> Tested-by: AutoSubmit Status <autosubmit_status_noreply@broadcom.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/f_mtp.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/usb/gadget/f_mtp.c b/drivers/usb/gadget/f_mtp.c
index 9ab94697c196..12fb818ab147 100644
--- a/drivers/usb/gadget/f_mtp.c
+++ b/drivers/usb/gadget/f_mtp.c
@@ -410,15 +410,6 @@ static int mtp_create_bulk_endpoints(struct mtp_dev *dev,
ep->driver_data = dev; /* claim the endpoint */
dev->ep_out = ep;
- ep = usb_ep_autoconfig(cdev->gadget, out_desc);
- if (!ep) {
- DBG(cdev, "usb_ep_autoconfig for ep_out failed\n");
- return -ENODEV;
- }
- DBG(cdev, "usb_ep_autoconfig for mtp ep_out got %s\n", ep->name);
- ep->driver_data = dev; /* claim the endpoint */
- dev->ep_out = ep;
-
ep = usb_ep_autoconfig(cdev->gadget, intr_desc);
if (!ep) {
DBG(cdev, "usb_ep_autoconfig for ep_intr failed\n");