[PATCH] epoll: fix dereferenced before check pt

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

 



This patch fixes the warning reported by smatch:

fs/eventpoll.c:889 ep_item_poll() warn: variable dereferenced before check 'pt'

Signed-off-by: Vasyl Gomonovych <gomonovych@xxxxxxxxx>
---
 fs/eventpoll.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index afd548ebc328..fc772a1f1396 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -879,7 +879,8 @@ static unsigned int ep_item_poll(struct epitem *epi, poll_table *pt, int depth)
 	struct eventpoll *ep;
 	bool locked;
 
-	pt->_key = epi->event.events;
+	if (pt)
+		pt->_key = epi->event.events;
 	if (!is_file_epoll(epi->ffd.file))
 		return epi->ffd.file->f_op->poll(epi->ffd.file, pt) &
 		       epi->event.events;
-- 
1.9.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