diff options
author | Felipe Balbi <balbi@ti.com> | 2012-11-08 08:26:41 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-11-08 08:26:41 -0500 |
commit | e32672f0bc7ec8421aa8e580e9f2216d3bec2505 (patch) | |
tree | 87c4143ebbbdf7451c9cf4b7f5382dac9bbe3ce6 /drivers/usb/dwc3 | |
parent | 7947699a4e0d960c36e01b01a4e518f35eea2265 (diff) |
usb: dwc3: core: don't kfree() devm_kzalloc()'ed memory
commit 380f0d2 (usb: dwc3: core: switch event
buffer allocation to devm_kzalloc()) was incomplete
leaving a trailing kfree(evt) in an error exit
path.
Fix this problem by removing the trailing kfree(evt).
Cc: Julia Lawall <julia.lawall@lip6.fr>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r-- | drivers/usb/dwc3/core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index d8d327a5e53b..2bd007d16461 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c | |||
@@ -153,10 +153,8 @@ dwc3_alloc_one_event_buffer(struct dwc3 *dwc, unsigned length) | |||
153 | evt->length = length; | 153 | evt->length = length; |
154 | evt->buf = dma_alloc_coherent(dwc->dev, length, | 154 | evt->buf = dma_alloc_coherent(dwc->dev, length, |
155 | &evt->dma, GFP_KERNEL); | 155 | &evt->dma, GFP_KERNEL); |
156 | if (!evt->buf) { | 156 | if (!evt->buf) |
157 | kfree(evt); | ||
158 | return ERR_PTR(-ENOMEM); | 157 | return ERR_PTR(-ENOMEM); |
159 | } | ||
160 | 158 | ||
161 | return evt; | 159 | return evt; |
162 | } | 160 | } |