Skip to content

Commit

Permalink
aio: use kmem_cache_free() instead of kfree()
Browse files Browse the repository at this point in the history
memory allocated by kmem_cache_alloc() should be freed using
kmem_cache_free(), not kfree().

Fixes: fa0ca2a ("deal with get_reqs_available() in aio_get_req() itself")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Wei Yongjun authored and Al Viro committed Apr 5, 2019
1 parent 27fad74 commit 6af1c84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ static inline struct aio_kiocb *aio_get_req(struct kioctx *ctx)
return NULL;

if (unlikely(!get_reqs_available(ctx))) {
kfree(req);
kmem_cache_free(kiocb_cachep, req);
return NULL;
}

Expand Down

0 comments on commit 6af1c84

Please sign in to comment.