diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 780bba695453a993cb733b4a95469cd05c7e8899..73b47cb533f223253ecac181bb2ff0592e90a12c 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -519,8 +519,10 @@ static int inotify_update_existing_watch(struct fsnotify_group *group, fsn_mark = fsnotify_find_mark(&inode->i_fsnotify_marks, group); if (!fsn_mark) return -ENOENT; - else if (create) - return -EEXIST; + else if (create) { + ret = -EEXIST; + goto out; + } i_mark = container_of(fsn_mark, struct inotify_inode_mark, fsn_mark); @@ -547,7 +549,7 @@ static int inotify_update_existing_watch(struct fsnotify_group *group, /* return the wd */ ret = i_mark->wd; - +out: /* match the get from fsnotify_find_mark() */ fsnotify_put_mark(fsn_mark);