diff options
author | Jens Axboe <axboe@kernel.dk> | 2023-02-24 09:54:57 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-02-24 12:58:31 -0700 |
commit | 977bc87356107fb946fb4ff24f1e4c241b5043ec (patch) | |
tree | f600ef39029c1c97b4f2aaadd749bab8d8affdb7 /io_uring/rsrc.c | |
parent | 57bebf807e2abcf87d96b9de1266104ee2d8fc2f (diff) | |
download | linux-stable-977bc87356107fb946fb4ff24f1e4c241b5043ec.tar.gz linux-stable-977bc87356107fb946fb4ff24f1e4c241b5043ec.tar.bz2 linux-stable-977bc87356107fb946fb4ff24f1e4c241b5043ec.zip |
io_uring/rsrc: always initialize 'folio' to NULL
Smatch complains that:
smatch warnings:
io_uring/rsrc.c:1262 io_sqe_buffer_register() error: uninitialized symbol 'folio'.
'folio' may be used uninitialized, which can happen if we end up with a
single page mapped. Ensure that we clear folio to NULL at the top so
it's always set.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/202302241432.YML1CD5C-lkp@intel.com/
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/rsrc.c')
-rw-r--r-- | io_uring/rsrc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index aab1bc6883e9..056f40946ff6 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -1210,7 +1210,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov, unsigned long off; size_t size; int ret, nr_pages, i; - struct folio *folio; + struct folio *folio = NULL; *pimu = ctx->dummy_ubuf; if (!iov->iov_base) |