[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] tests/qtest/migration: Initialize buffer in probe_o_direct_s
From: |
Fabiano Rosas |
Subject: |
[PATCH 2/6] tests/qtest/migration: Initialize buffer in probe_o_direct_support |
Date: |
Mon, 9 Dec 2024 17:44:23 -0300 |
Valgrind complains about the probe_o_direct_support() function reading
from an uninitialized buffer. For probing O_DIRECT support we don't
actually need to write to the file, just make sure the pwrite call
doesn't reject the write. Still, write zeroes to the buffer to
suppress the warning.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
tests/qtest/migration-helpers.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
index 3f8ba7fa8e..981910ba35 100644
--- a/tests/qtest/migration-helpers.c
+++ b/tests/qtest/migration-helpers.c
@@ -496,6 +496,7 @@ bool probe_o_direct_support(const char *tmpfs)
buf = qemu_try_memalign(len, len);
g_assert(buf);
+ memset(buf, 0, len);
ret = pwrite(fd, buf, len, offset);
unlink(filename);
--
2.35.3
- [PATCH 0/6] qtest: Fix some memory issues, Fabiano Rosas, 2024/12/09
- [PATCH 1/6] tests/qtest/migration: Do proper cleanup in the dirty_limit test, Fabiano Rosas, 2024/12/09
- [PATCH 2/6] tests/qtest/migration: Initialize buffer in probe_o_direct_support,
Fabiano Rosas <=
- [PATCH 3/6] tests/qtest/bios-tables-test: Free tables at dump_aml_files, Fabiano Rosas, 2024/12/09
- [PATCH 5/6] tests/qtest/qos-test: Plug a couple of leaks, Fabiano Rosas, 2024/12/09
- [PATCH 6/6] tests/qtest/test-x86-cpuid-compat: Free allocated memory, Fabiano Rosas, 2024/12/09
- [PATCH 4/6] tests/qtest/virtio-iommu-test: Don't pass uninitialized data into qtest_memwrite, Fabiano Rosas, 2024/12/09
- Re: [PATCH 0/6] qtest: Fix some memory issues, Fabiano Rosas, 2024/12/17