summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorMayank Rana <mrana@codeaurora.org>2015-05-18 18:27:53 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:06:51 -0700
commit32db5976ed6874e03420c77c739f0be89c1bd461 (patch)
tree5da637f89405a0673ddfa761a6a4ee4e1126c2b5 /drivers/usb
parent865addc7d416be1d8387a78df26ff4ca5b3a4d80 (diff)
dwc3: gadget: Initialized USB TRBs pool memory with zero
dma_coherent_alloc() API doesn't guaranteed that allocated memory is initialized with zero. It is observed in some cases where there is stale data seen with allocated memory for TRB pool and providing this TRB with USB controller results into different memory access issues. Fix this issue by using dma_zalloc_coherent() API which allocates memory and initialized it with zero. Change-Id: I160e319aace262958a11ba5196f53ec21b98977f Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc3/gadget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 0a7751794c52..aac030a52666 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -392,7 +392,7 @@ static int dwc3_alloc_trb_pool(struct dwc3_ep *dep)
if (dep->trb_pool)
return 0;
- dep->trb_pool = dma_alloc_coherent(dwc->dev,
+ dep->trb_pool = dma_zalloc_coherent(dwc->dev,
sizeof(struct dwc3_trb) * DWC3_TRB_NUM,
&dep->trb_pool_dma, GFP_KERNEL);
if (!dep->trb_pool) {