diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-02-22 09:10:32 +0100 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2016-03-04 14:14:45 +0100 |
commit | 9bbe91a1ea4cae20ff9f8f175c92e1e49b4296d9 (patch) | |
tree | c470423f4f31eb7f972978079a786bdda0150973 /drivers/usb/dwc2/hcd_ddma.c | |
parent | usb: dwc2: host: If using uframe scheduler, end splits better (diff) | |
download | linux-9bbe91a1ea4cae20ff9f8f175c92e1e49b4296d9.tar.xz linux-9bbe91a1ea4cae20ff9f8f175c92e1e49b4296d9.zip |
usb: dwc2: Use kmem_cache_free()
Here, free memory is allocated using kmem_cache_zalloc. So, use
kmem_cache_free instead of kfree.
This is done using Coccinelle and semantic patch used
is as follows:
//<smpl>
@@
expression x,E,c;
@@
x =
\(kmem_cache_alloc\|kmem_cache_zalloc\|kmem_cache_alloc_node\)(c,...)
... when != x = E
when != &x
?-kfree(x)
+kmem_cache_free(c,x)
//</smpl>
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/dwc2/hcd_ddma.c')
-rw-r--r-- | drivers/usb/dwc2/hcd_ddma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c index 2ff517a0210f..27350d0b1c50 100644 --- a/drivers/usb/dwc2/hcd_ddma.c +++ b/drivers/usb/dwc2/hcd_ddma.c @@ -111,7 +111,7 @@ static int dwc2_desc_list_alloc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, dma_unmap_single(hsotg->dev, qh->desc_list_dma, qh->desc_list_sz, DMA_FROM_DEVICE); - kfree(qh->desc_list); + kmem_cache_free(desc_cache, qh->desc_list); qh->desc_list = NULL; return -ENOMEM; } |