diff options
-rw-r--r-- | fs/notify/inotify/inotify_fsnotify.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c index 0f88bc0b4e6c..7d888d77d59a 100644 --- a/fs/notify/inotify/inotify_fsnotify.c +++ b/fs/notify/inotify/inotify_fsnotify.c | |||
@@ -165,8 +165,10 @@ static void inotify_free_group_priv(struct fsnotify_group *group) | |||
165 | /* ideally the idr is empty and we won't hit the BUG in the callback */ | 165 | /* ideally the idr is empty and we won't hit the BUG in the callback */ |
166 | idr_for_each(&group->inotify_data.idr, idr_callback, group); | 166 | idr_for_each(&group->inotify_data.idr, idr_callback, group); |
167 | idr_destroy(&group->inotify_data.idr); | 167 | idr_destroy(&group->inotify_data.idr); |
168 | atomic_dec(&group->inotify_data.user->inotify_devs); | 168 | if (group->inotify_data.user) { |
169 | free_uid(group->inotify_data.user); | 169 | atomic_dec(&group->inotify_data.user->inotify_devs); |
170 | free_uid(group->inotify_data.user); | ||
171 | } | ||
170 | } | 172 | } |
171 | 173 | ||
172 | static void inotify_free_event(struct fsnotify_event *fsn_event) | 174 | static void inotify_free_event(struct fsnotify_event *fsn_event) |