Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/powerpc/papr-vpd: Fix missing variable initialization

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

authored by

Nathan Lynch and committed by
Michael Ellerman
210cfef5 69630926

+1 -1
+1 -1
tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
··· 154 154 static int papr_vpd_close_handle_without_reading(void) 155 155 { 156 156 const int devfd = open(DEVPATH, O_RDONLY); 157 - struct papr_location_code lc; 157 + struct papr_location_code lc = { .str = "", }; 158 158 int fd; 159 159 160 160 SKIP_IF_MSG(devfd < 0 && errno == ENOENT,