io_uring/net: checks errors of zc mem accounting
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 25 Jul 2022 09:52:04 +0000 (10:52 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jul 2022 15:48:17 +0000 (09:48 -0600)
mm_account_pinned_pages() may fail, don't ignore the return value.

Fixes: e29e3bd4b968 ("io_uring: account locked pages for non-fixed zc")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/dae0542ed8e6706071bb83ad3e7ad6a70d207fd9.1658742118.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/net.c

index 62be898..8fb8469 100644 (file)
@@ -985,7 +985,9 @@ int io_sendzc(struct io_kiocb *req, unsigned int issue_flags)
                                          &msg.msg_iter);
                if (unlikely(ret))
                        return ret;
-               mm_account_pinned_pages(&notif->uarg.mmp, zc->len);
+               ret = mm_account_pinned_pages(&notif->uarg.mmp, zc->len);
+               if (unlikely(ret))
+                       return ret;
        }
 
        if (zc->addr) {