io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 5 Dec 2023 12:37:17 +0000 (15:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:45:17 +0000 (18:45 +0100)
commitb2173a8b64507f5be03c195614a491778e6963cc
tree38533c5b202d685547c79113267c163ee4cc2151
parentfe145559a91f731c7039158e37eb38b1773ecd41
io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring()

[ Upstream commit e53f7b54b1fdecae897f25002ff0cff04faab228 ]

The io_mem_alloc() function returns error pointers, not NULL.  Update
the check accordingly.

Fixes: b10b73c102a2 ("io_uring/kbuf: recycle freed mapped buffer ring entries")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/5ed268d3-a997-4f64-bd71-47faa92101ab@moroto.mountain
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/kbuf.c