Skip to content

Commit

Permalink
skd: Use kmem_cache_free
Browse files Browse the repository at this point in the history
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: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Himanshu Jha authored and Jens Axboe committed Oct 9, 2017
1 parent 17d084c commit 09aa97c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/skd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2604,7 +2604,7 @@ static void *skd_alloc_dma(struct skd_device *skdev, struct kmem_cache *s,
return NULL;
*dma_handle = dma_map_single(dev, buf, s->size, dir);
if (dma_mapping_error(dev, *dma_handle)) {
kfree(buf);
kmem_cache_free(s, buf);
buf = NULL;
}
return buf;
Expand Down

0 comments on commit 09aa97c

Please sign in to comment.