From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shawn Bohrer Subject: [PATCH 1/3] epoll: initialize slack for negative timeout values Date: Sat, 15 Jan 2011 11:00:35 -0600 Message-ID: <1295110837-3061-1-git-send-email-shawn.bohrer@gmail.com> References: <20110115162027.GA2552@lintop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jack Stone , Viresh Kumar , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, Davide Libenzi , Shawn Bohrer To: Andrew Morton Return-path: In-Reply-To: <20110115162027.GA2552@lintop> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org When a negative timeout value is passed to epoll the 'slack' variable i= s currently unitialized: fs/eventpoll.c: In function =E2=80=98ep_poll=E2=80=99: fs/eventpoll.c:1119: warning: =E2=80=98slack=E2=80=99 may be used unini= tialized 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 i= t. Signed-off-by: Shawn Bohrer Acked-by: Davide Libenzi --- 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 e= poll_event __user *events, { int res, eavail, timed_out =3D 0; unsigned long flags; - long slack; + long slack =3D 0; wait_queue_t wait; struct timespec end_time; ktime_t expires, *to =3D NULL; --=20 1.7.3.4