Commit b2967b49 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] aio: fix error-path mm leak in ioctx_alloc

From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

ioctx_alloc() leaks an mm->mm_count ref on an error path.
parent d8055027
...@@ -258,6 +258,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) ...@@ -258,6 +258,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events)
return ERR_PTR(-EAGAIN); return ERR_PTR(-EAGAIN);
out_freectx: out_freectx:
mmdrop(mm);
kmem_cache_free(kioctx_cachep, ctx); kmem_cache_free(kioctx_cachep, ctx);
ctx = ERR_PTR(-ENOMEM); ctx = ERR_PTR(-ENOMEM);
......
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