Commit 09aa97c7 authored by Himanshu Jha's avatar Himanshu Jha Committed by Jens Axboe

skd: Use kmem_cache_free

Use kmem_cache_free instead of kfree for freeing the memory previously
allocated with kmem_cache_zalloc/kmem_cache_alloc/kmem_cache_node.
Signed-off-by: default avatarHimanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 17d084c8
...@@ -2604,7 +2604,7 @@ static void *skd_alloc_dma(struct skd_device *skdev, struct kmem_cache *s, ...@@ -2604,7 +2604,7 @@ static void *skd_alloc_dma(struct skd_device *skdev, struct kmem_cache *s,
return NULL; return NULL;
*dma_handle = dma_map_single(dev, buf, s->size, dir); *dma_handle = dma_map_single(dev, buf, s->size, dir);
if (dma_mapping_error(dev, *dma_handle)) { if (dma_mapping_error(dev, *dma_handle)) {
kfree(buf); kmem_cache_free(s, buf);
buf = NULL; buf = NULL;
} }
return buf; return buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment