Skip to contentSkip to conversation

epoll: extra check in ep_item_poll()

PATCH New Vasily Averin 1 participant 1 message Jun 7, 2020 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 epoll: extra check in ep_item_poll()

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

---
 fs/eventpoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/eventpoll.c +1 -1
index 12eebcd..5ddb549 100644
@@ -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,
Signature · 1 line
1.8.3.1