From: Keith Busch Date: Mon, 11 Mar 2019 16:46:47 +0000 (-0600) Subject: t/io_uring: memset() allocated memory X-Git-Tag: fio-3.14~22 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=d9c50de7c1d95e5c173ac6d7f5b3f0d63131f8b4;p=fio.git t/io_uring: memset() allocated memory But I totally rushed this patch and just sent it once I heard it "worked", and it really doesn't because malloc doesn't zero the buffer. My mistake, kzalloc spoiled me. Here's the fix: Fixes: e39863e3cb61 ("t/io_uring: add depth options") Signed-off-by: Jens Axboe --- diff --git a/t/io_uring.c b/t/io_uring.c index 36aede9b..363cba3e 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -526,7 +526,8 @@ int main(int argc, char *argv[]) } } - submitter = malloc(sizeof(*submitter) * depth * sizeof(struct iovec)); + submitter = malloc(sizeof(*submitter) + depth * sizeof(struct iovec)); + memset(submitter, 0, sizeof(*submitter) + depth * sizeof(struct iovec)); s = submitter; flags = O_RDONLY | O_NOATIME;