Thermal/int340x/int3403: Fix memory leak
[cascardo/linux.git] / fs / aio.c
index bfab556..1b7893e 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1253,8 +1253,12 @@ static long read_events(struct kioctx *ctx, long min_nr, long nr,
         * the ringbuffer empty. So in practice we should be ok, but it's
         * something to be aware of when touching this code.
         */
-       wait_event_interruptible_hrtimeout(ctx->wait,
-                       aio_read_events(ctx, min_nr, nr, event, &ret), until);
+       if (until.tv64 == 0)
+               aio_read_events(ctx, min_nr, nr, event, &ret);
+       else
+               wait_event_interruptible_hrtimeout(ctx->wait,
+                               aio_read_events(ctx, min_nr, nr, event, &ret),
+                               until);
 
        if (!ret && signal_pending(current))
                ret = -EINTR;