summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohith Seelaboyina <rseelaboyina@nvidia.com>2014-01-28 11:59:35 +0530
committerHarry Hong <hhong@nvidia.com>2014-02-03 20:04:40 -0800
commit2477aa4dd63d241983ed9828c7384970027892c2 (patch)
tree37f42fccec89425e67df68a95999a417c0156ecf
parent6a27bb299734380573640b2b0e2fdf31f4b8a41c (diff)
usb: gadget: tegra: check ep->desc before access
This changes adds condition to check ep->desc before accessing its contents. ep->desc seems to get Null on releasing the spin_lock. Bug 1401730 Change-Id: I48b4c880ced0cd131bd45840839e6635fc1a219c Signed-off-by: Rohith Seelaboyina <rseelaboyina@nvidia.com> Reviewed-on: http://git-master/r/362353 (cherry picked from commit 790be48ddf070df3e6357b4e290d8fb4c603a34e) Reviewed-on: http://git-master/r/363103 Reviewed-by: Harry Hong <hhong@nvidia.com> Tested-by: Harry Hong <hhong@nvidia.com>
-rw-r--r--drivers/usb/gadget/tegra_udc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/tegra_udc.c b/drivers/usb/gadget/tegra_udc.c
index 6bcf279f9855..86e40fde62bb 100644
--- a/drivers/usb/gadget/tegra_udc.c
+++ b/drivers/usb/gadget/tegra_udc.c
@@ -1135,7 +1135,7 @@ static int tegra_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
/* Enable EP */
out:
/* Touch the registers if cable is connected and phy is on */
- if (udc->vbus_active) {
+ if (udc->vbus_active && ep->desc) {
epctrl = udc_readl(udc, EP_CONTROL_REG_OFFSET + (ep_num * 4));
if (ep_is_in(ep))
epctrl |= EPCTRL_TX_ENABLE;