From: Vasyl Gomonovych <gomonovych@gmail.com>
To: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
gomonovych@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] epoll: fix dereferenced before check pt
Date: Thu, 21 Dec 2017 16:54:17 +0100 [thread overview]
Message-ID: <1513871657-11239-1-git-send-email-gomonovych@gmail.com> (raw)
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@gmail.com>
---
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
next reply other threads:[~2017-12-21 15:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-21 15:54 Vasyl Gomonovych [this message]
2017-12-22 0:02 ` [PATCH] epoll: fix dereferenced before check pt Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1513871657-11239-1-git-send-email-gomonovych@gmail.com \
--to=gomonovych@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).