Skip to content

Commit dcb6e6e

Browse files
Al Virogregkh
authored andcommitted
do_epoll_ctl(): clean the failure exits up a bit
commit 52c4796 upstream. Signed-off-by: Al Viro <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4957d56 commit dcb6e6e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

fs/eventpoll.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,10 +2094,8 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
20942094
mutex_lock(&epmutex);
20952095
if (is_file_epoll(tf.file)) {
20962096
error = -ELOOP;
2097-
if (ep_loop_check(ep, tf.file) != 0) {
2098-
clear_tfile_check_list();
2097+
if (ep_loop_check(ep, tf.file) != 0)
20992098
goto error_tgt_fput;
2100-
}
21012099
} else {
21022100
get_file(tf.file);
21032101
list_add(&tf.file->f_tfile_llink,
@@ -2126,8 +2124,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
21262124
error = ep_insert(ep, &epds, tf.file, fd, full_check);
21272125
} else
21282126
error = -EEXIST;
2129-
if (full_check)
2130-
clear_tfile_check_list();
21312127
break;
21322128
case EPOLL_CTL_DEL:
21332129
if (epi)
@@ -2150,8 +2146,10 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
21502146
mutex_unlock(&ep->mtx);
21512147

21522148
error_tgt_fput:
2153-
if (full_check)
2149+
if (full_check) {
2150+
clear_tfile_check_list();
21542151
mutex_unlock(&epmutex);
2152+
}
21552153

21562154
fdput(tf);
21572155
error_fput:

0 commit comments

Comments
 (0)