[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1290655909-10616-1-git-send-email-shawn.bohrer@gmail.com>
Date: Wed, 24 Nov 2010 21:31:49 -0600
From: Shawn Bohrer <shawn.bohrer@...il.com>
To: Davide Libenzi <davidel@...ilserver.org>
Cc: Mike Frysinger <vapier.adi@...il.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Shawn Bohrer <shawn.bohrer@...il.com>
Subject: [PATCH] epoll: initialize slack for negative timeout values
When a negative timeout value is passed to epoll the 'slack' variable is
currently uninitialized:
fs/eventpoll.c: In function ‘ep_poll’:
fs/eventpoll.c:1119: warning: ‘slack’ may be used uninitialized in this function
In this case a NULL pointer is passed to schedule_hrtimeout_range()
specifying an infinite timeout. The current implementation of
schedule_hrtimeout_range() does not use slack in this case, but we
should still initialize slack to 0 in case future implementations use it.
Signed-off-by: Shawn Bohrer <shawn.bohrer@...il.com>
---
fs/eventpoll.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 8cf0724..c24a032 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1116,7 +1116,7 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
{
int res, eavail, timed_out = 0;
unsigned long flags;
- long slack;
+ long slack = 0;
wait_queue_t wait;
struct timespec end_time;
ktime_t expires, *to = NULL;
--
1.7.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists