diff mbox series

epoll: extra check in ep_item_poll()

Message ID f56c28cb-565c-6cc0-8ed6-34492cacc300@virtuozzo.com (mailing list archive)
State New, archived
Headers show
Series epoll: extra check in ep_item_poll() | expand

Commit Message

Vasily Averin June 7, 2020, 7:10 a.m. UTC
reported by smatch:
fs/eventpoll.c:891 ep_item_poll() warn:
 variable dereferenced before check 'pt' (see line 885)

ep_item_poll() is newer called with empty 'pt' argument,
and it is dereferenced in the beginning of this function,
so 'pt' check in line 891 looks useless

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 fs/eventpoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 12eebcd..5ddb549 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -888,7 +888,7 @@  static __poll_t ep_item_poll(const struct epitem *epi, poll_table *pt,
 
 	ep = epi->ffd.file->private_data;
 	poll_wait(epi->ffd.file, &ep->poll_wait, pt);
-	locked = pt && (pt->_qproc == ep_ptable_queue_proc);
+	locked = (pt->_qproc == ep_ptable_queue_proc);
 
 	return ep_scan_ready_list(epi->ffd.file->private_data,
 				  ep_read_events_proc, &depth, depth,