summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2020-10-12 15:03:41 +0100
committerJens Axboe <axboe@kernel.dk>2020-10-17 09:25:41 -0600
commit035fbafc7a54b8c7755b3c508b8f3ab6ff3c8d65 (patch)
tree2f0aa308ff6499f7bc9bcf25ac263bf726c59796 /fs/io_uring.c
parent071a0578b0ce0b0e543d1e38ee6926b9cc21c198 (diff)
downloadlwn-035fbafc7a54b8c7755b3c508b8f3ab6ff3c8d65.tar.gz
lwn-035fbafc7a54b8c7755b3c508b8f3ab6ff3c8d65.zip
io_uring: Fix sizeof() mismatch
An incorrect sizeof() is being used, sizeof(file_data->table) is not correct, it should be sizeof(*file_data->table). Fixes: 5398ae698525 ("io_uring: clean file_data access in files_register") Signed-off-by: Colin Ian King <colin.king@canonical.com> Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)") Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 2e1dc354cd08..717dd5d38d75 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -7306,7 +7306,7 @@ static int io_sqe_files_register(struct io_ring_ctx *ctx, void __user *arg,
spin_lock_init(&file_data->lock);
nr_tables = DIV_ROUND_UP(nr_args, IORING_MAX_FILES_TABLE);
- file_data->table = kcalloc(nr_tables, sizeof(file_data->table),
+ file_data->table = kcalloc(nr_tables, sizeof(*file_data->table),
GFP_KERNEL);
if (!file_data->table)
goto out_free;