summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io_uring/io_uring.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 6852878e7762..eb7e3aa85fa3 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -5751,10 +5751,12 @@ static int io_arm_poll_handler(struct io_kiocb *req)
mask |= POLLOUT | POLLWRNORM;
}
- if (req->flags & REQ_F_POLLED)
+ if (req->flags & REQ_F_POLLED) {
apoll = req->apoll;
- else
+ kfree(apoll->double_poll);
+ } else {
apoll = kmalloc(sizeof(*apoll), GFP_ATOMIC);
+ }
if (unlikely(!apoll))
return IO_APOLL_ABORTED;
apoll->double_poll = NULL;