summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Lynch <nathanl@linux.ibm.com>2024-04-05 01:02:09 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-27 18:12:56 +0300
commitc8dbaa9ea2a1c4db5c8b5f27c2babe28b78b5e93 (patch)
tree684d7255e0813a592a27c3fae35575184f2b929c
parent6c4af011a9071ba70c763b99d2ff982a3805bb23 (diff)
downloadlinux-c8dbaa9ea2a1c4db5c8b5f27c2babe28b78b5e93.tar.xz
selftests/powerpc/papr-vpd: Fix missing variable initialization
[ Upstream commit 210cfef579260ed6c3b700e7baeae51a5e183f43 ] The "close handle without consuming VPD" testcase has inconsistent results because it fails to initialize the location code object it passes to ioctl() to create a VPD handle. Initialize the location code to the empty string as intended. Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com> Fixes: 9118c5d32bdd ("powerpc/selftests: Add test for papr-vpd") Reported-by: Geetika Moolchandani <geetika@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240404-papr-vpd-test-uninit-lc-v2-1-37bff46c65a5@linux.ibm.com Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c b/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
index 505294da1b9f..d6f99eb9be65 100644
--- a/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
+++ b/tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
@@ -154,7 +154,7 @@ static int dev_papr_vpd_null_handle(void)
static int papr_vpd_close_handle_without_reading(void)
{
const int devfd = open(DEVPATH, O_RDONLY);
- struct papr_location_code lc;
+ struct papr_location_code lc = { .str = "", };
int fd;
SKIP_IF_MSG(devfd < 0 && errno == ENOENT,