diff options
Diffstat (limited to 'fs/notify/inotify/inotify_user.c')
-rw-r--r-- | fs/notify/inotify/inotify_user.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 9e4f90042eaf..8271cf05c957 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c | |||
@@ -646,6 +646,7 @@ SYSCALL_DEFINE1(inotify_init1, int, flags) | |||
646 | struct fsnotify_group *group; | 646 | struct fsnotify_group *group; |
647 | struct user_struct *user; | 647 | struct user_struct *user; |
648 | struct file *filp; | 648 | struct file *filp; |
649 | struct path path; | ||
649 | int fd, ret; | 650 | int fd, ret; |
650 | 651 | ||
651 | /* Check the IN_* constants for consistency. */ | 652 | /* Check the IN_* constants for consistency. */ |
@@ -675,8 +676,10 @@ SYSCALL_DEFINE1(inotify_init1, int, flags) | |||
675 | 676 | ||
676 | atomic_inc(&user->inotify_devs); | 677 | atomic_inc(&user->inotify_devs); |
677 | 678 | ||
678 | filp = alloc_file(inotify_mnt, dget(inotify_mnt->mnt_root), | 679 | path.mnt = inotify_mnt; |
679 | FMODE_READ, &inotify_fops); | 680 | path.dentry = inotify_mnt->mnt_root; |
681 | path_get(&path); | ||
682 | filp = alloc_file(&path, FMODE_READ, &inotify_fops); | ||
680 | if (!filp) | 683 | if (!filp) |
681 | goto Enfile; | 684 | goto Enfile; |
682 | 685 | ||
@@ -689,6 +692,7 @@ SYSCALL_DEFINE1(inotify_init1, int, flags) | |||
689 | 692 | ||
690 | Enfile: | 693 | Enfile: |
691 | ret = -ENFILE; | 694 | ret = -ENFILE; |
695 | path_put(&path); | ||
692 | atomic_dec(&user->inotify_devs); | 696 | atomic_dec(&user->inotify_devs); |
693 | out_free_uid: | 697 | out_free_uid: |
694 | free_uid(user); | 698 | free_uid(user); |