From 2e32ba5607ee2b668baa8831dd74f7cc867a1f7e Mon Sep 17 00:00:00 2001 From: Pavel Begunkov Date: Mon, 25 Jul 2022 10:52:04 +0100 Subject: io_uring/net: checks errors of zc mem accounting 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 Link: https://lore.kernel.org/r/dae0542ed8e6706071bb83ad3e7ad6a70d207fd9.1658742118.git.asml.silence@gmail.com Signed-off-by: Jens Axboe --- io_uring/net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'io_uring') diff --git a/io_uring/net.c b/io_uring/net.c index 62be89837d82..8fb8469c3315 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -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(¬if->uarg.mmp, zc->len); + ret = mm_account_pinned_pages(¬if->uarg.mmp, zc->len); + if (unlikely(ret)) + return ret; } if (zc->addr) { -- cgit v1.2.3