Skip to content

Commit 977bc87

Browse files
committed
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 <[email protected]> Reported-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Jens Axboe <[email protected]>
1 parent 57bebf8 commit 977bc87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/rsrc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov,
12101210
unsigned long off;
12111211
size_t size;
12121212
int ret, nr_pages, i;
1213-
struct folio *folio;
1213+
struct folio *folio = NULL;
12141214

12151215
*pimu = ctx->dummy_ubuf;
12161216
if (!iov->iov_base)

0 commit comments

Comments
 (0)