diff options
author | Eric Paris <eparis@redhat.com> | 2010-11-23 18:18:37 -0500 |
---|---|---|
committer | AK <andi@firstfloor.org> | 2011-02-06 11:03:41 -0800 |
commit | a1a584f5c28939e5c11d062b233599034748d6dd (patch) | |
tree | 6da1f7c2ec91ddd72689444fdf64a42adcc1668c /fs | |
parent | 6559ff535c6a7d61eb22295ddf390ac917f46275 (diff) |
inotify: stop kernel memory leak on file creation failure
commit a2ae4cc9a16e211c8a128ba10d22a85431f093ab upstream.
If inotify_init is unable to allocate a new file for the new inotify
group we leak the new group. This patch drops the reference on the
group on file allocation failure.
Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/notify/inotify/inotify_user.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 0c6bbc031f1..72f88255260 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -674,6 +674,7 @@ SYSCALL_DEFINE1(inotify_init1, int, flags) if (ret >= 0) return ret; + fsnotify_put_group(group); atomic_dec(&user->inotify_devs); out_free_uid: free_uid(user); |