summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirupathi Chippakurthy <thirupathi.chippakurthy@stericsson.com>2011-10-03 11:19:39 +0530
committerSrinidhi KASAGAR <srinidhi.kasagar@stericsson.com>2011-10-03 08:07:07 +0200
commit78114a2c82f40fab85a104eeebb40f67c9493b25 (patch)
tree79c5b884b06518d611a6240c0501ebd72bef2dab
parent6af7a3ed543e355b4345f8565f009c412fcf1bf2 (diff)
android: usb: fix crashes in ecm_set_alt()
Added fix for crash in ecm_set_alt(). This patch is based on the changes done for RNDIS in the patch commit id 789ef237b38a79f988738ff18ae6d756551afb92 ACM in the patch commit id 0ab69f47e172739fd499f09469fde6eb16e9287d ST-Ericsson ID:AP 365052 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: NA Change-Id: I673d5bc1632bcd4b382c96373501e797a4dc6287 Signed-off-by: Thirupathi <thirupathi.chippakurthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32673 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r--drivers/usb/gadget/f_ecm.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c
index 544257a89ed..50437cca770 100644
--- a/drivers/usb/gadget/f_ecm.c
+++ b/drivers/usb/gadget/f_ecm.c
@@ -466,10 +466,10 @@ static int ecm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
usb_ep_disable(ecm->notify);
} else {
VDBG(cdev, "init ecm ctrl %d\n", intf);
- ecm->notify_desc = ep_choose(cdev->gadget,
- ecm->hs.notify,
- ecm->fs.notify);
}
+ ecm->notify_desc = ep_choose(cdev->gadget,
+ ecm->hs.notify,
+ ecm->fs.notify);
usb_ep_enable(ecm->notify, ecm->notify_desc);
ecm->notify->driver_data = ecm;
@@ -483,13 +483,13 @@ static int ecm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
gether_disconnect(&ecm->port);
}
- if (!ecm->port.in) {
+ if (!ecm->port.in)
DBG(cdev, "init ecm\n");
- ecm->port.in = ep_choose(cdev->gadget,
- ecm->hs.in, ecm->fs.in);
- ecm->port.out = ep_choose(cdev->gadget,
- ecm->hs.out, ecm->fs.out);
- }
+
+ ecm->port.in = ep_choose(cdev->gadget,
+ ecm->hs.in, ecm->fs.in);
+ ecm->port.out = ep_choose(cdev->gadget,
+ ecm->hs.out, ecm->fs.out);
/* CDC Ethernet only sends data in non-default altsettings.
* Changing altsettings resets filters, statistics, etc.