diff options
author | 2021-04-26 00:16:31 +0100 | |
---|---|---|
committer | 2021-04-26 06:50:35 -0600 | |
commit | a2b4198cab7e3edcb78fce77e0e8aca130435403 (patch) | |
tree | 4848641c12a0c48a966f1efe6072e3936aade41a /fs/io_uring.c | |
parent | io_uring: io_sq_thread() no longer needs to reset current->pf_io_worker (diff) | |
download | linux-a2b4198cab7e3edcb78fce77e0e8aca130435403.tar.gz linux-a2b4198cab7e3edcb78fce77e0e8aca130435403.tar.bz2 linux-a2b4198cab7e3edcb78fce77e0e8aca130435403.zip |
io_uring: fix invalid error check after malloc
Now we allocate io_mapped_ubuf instead of bvec, so we clearly have to
check its address after allocation.
Fixes: 41edf1a5ec967 ("io_uring: keep table of pointers to ubufs")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d28eb1bc4384284f69dbce35b9f70c115ff6176f.1619392565.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index eef373394ee9..b65a25384019 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -8265,7 +8265,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov, goto done; imu = kvmalloc(struct_size(imu, bvec, nr_pages), GFP_KERNEL); - if (!imu->bvec) + if (!imu) goto done; ret = 0; |