mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
usb: gadget: drop null test before destroy functions
Remove unneeded NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
9a9ce1dfae
commit
51b91b7e6c
4 changed files with 4 additions and 8 deletions
|
@ -324,8 +324,7 @@ static void bdc_mem_free(struct bdc *bdc)
|
|||
bdc->scratchpad.buff, bdc->scratchpad.sp_dma);
|
||||
|
||||
/* Destroy the dma pools */
|
||||
if (bdc->bd_table_pool)
|
||||
dma_pool_destroy(bdc->bd_table_pool);
|
||||
dma_pool_destroy(bdc->bd_table_pool);
|
||||
|
||||
/* Free the bdc_ep array */
|
||||
kfree(bdc->bdc_ep_array);
|
||||
|
|
|
@ -2117,8 +2117,7 @@ static int gr_remove(struct platform_device *pdev)
|
|||
return -EBUSY;
|
||||
|
||||
gr_dfs_delete(dev);
|
||||
if (dev->desc_pool)
|
||||
dma_pool_destroy(dev->desc_pool);
|
||||
dma_pool_destroy(dev->desc_pool);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
gr_free_request(&dev->epi[0].ep, &dev->ep0reqi->req);
|
||||
|
|
|
@ -1767,8 +1767,7 @@ static int mv_u3d_remove(struct platform_device *dev)
|
|||
usb_del_gadget_udc(&u3d->gadget);
|
||||
|
||||
/* free memory allocated in probe */
|
||||
if (u3d->trb_pool)
|
||||
dma_pool_destroy(u3d->trb_pool);
|
||||
dma_pool_destroy(u3d->trb_pool);
|
||||
|
||||
if (u3d->ep_context)
|
||||
dma_free_coherent(&dev->dev, u3d->ep_context_size,
|
||||
|
|
|
@ -2100,8 +2100,7 @@ static int mv_udc_remove(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
/* free memory allocated in probe */
|
||||
if (udc->dtd_pool)
|
||||
dma_pool_destroy(udc->dtd_pool);
|
||||
dma_pool_destroy(udc->dtd_pool);
|
||||
|
||||
if (udc->ep_dqh)
|
||||
dma_free_coherent(&pdev->dev, udc->ep_dqh_size,
|
||||
|
|
Loading…
Reference in a new issue