[PATCH] epoll: extra check in ep_item_poll()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 fs/eventpoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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,
-- 
1.8.3.1




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux