summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/udc/bdc/bdc_ep.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/udc/bdc/bdc_ep.c')
-rw-r--r--drivers/usb/gadget/udc/bdc/bdc_ep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c
index d1b81539d632..d6199507f861 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_ep.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c
@@ -159,8 +159,10 @@ static int ep_bd_list_alloc(struct bdc_ep *ep)
bd_table->start_bd = dma_pool_alloc(bdc->bd_table_pool,
GFP_ATOMIC,
&dma);
- if (!bd_table->start_bd)
+ if (!bd_table->start_bd) {
+ kfree(bd_table);
goto fail;
+ }
bd_table->dma = dma;