do_epoll_ctl(): clean the failure exits up a bit

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 52c47969 a9ed4a65

+6 -13
+6 -13
fs/eventpoll.c
··· 2203 2203 full_check = 1; 2204 2204 if (is_file_epoll(tf.file)) { 2205 2205 error = -ELOOP; 2206 - if (ep_loop_check(ep, tf.file) != 0) { 2207 - clear_tfile_check_list(); 2206 + if (ep_loop_check(ep, tf.file) != 0) 2208 2207 goto error_tgt_fput; 2209 - } 2210 2208 } else { 2211 2209 get_file(tf.file); 2212 2210 list_add(&tf.file->f_tfile_llink, 2213 2211 &tfile_check_list); 2214 2212 } 2215 2213 error = epoll_mutex_lock(&ep->mtx, 0, nonblock); 2216 - if (error) { 2217 - out_del: 2218 - list_del(&tf.file->f_tfile_llink); 2219 - if (!is_file_epoll(tf.file)) 2220 - fput(tf.file); 2214 + if (error) 2221 2215 goto error_tgt_fput; 2222 - } 2223 2216 if (is_file_epoll(tf.file)) { 2224 2217 tep = tf.file->private_data; 2225 2218 error = epoll_mutex_lock(&tep->mtx, 1, nonblock); 2226 2219 if (error) { 2227 2220 mutex_unlock(&ep->mtx); 2228 - goto out_del; 2221 + goto error_tgt_fput; 2229 2222 } 2230 2223 } 2231 2224 } ··· 2239 2246 error = ep_insert(ep, epds, tf.file, fd, full_check); 2240 2247 } else 2241 2248 error = -EEXIST; 2242 - if (full_check) 2243 - clear_tfile_check_list(); 2244 2249 break; 2245 2250 case EPOLL_CTL_DEL: 2246 2251 if (epi) ··· 2261 2270 mutex_unlock(&ep->mtx); 2262 2271 2263 2272 error_tgt_fput: 2264 - if (full_check) 2273 + if (full_check) { 2274 + clear_tfile_check_list(); 2265 2275 mutex_unlock(&epmutex); 2276 + } 2266 2277 2267 2278 fdput(tf); 2268 2279 error_fput: