Skip to content

Commit 210cfef

Browse files
nathanlynchmpe
authored andcommitted
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 <[email protected]> Fixes: 9118c5d ("powerpc/selftests: Add test for papr-vpd") Reported-by: Geetika Moolchandani <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent 6963092 commit 210cfef

File tree

1 file changed

+1
-1
lines changed
  • tools/testing/selftests/powerpc/papr_vpd

1 file changed

+1
-1
lines changed

tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static int dev_papr_vpd_null_handle(void)
154154
static int papr_vpd_close_handle_without_reading(void)
155155
{
156156
const int devfd = open(DEVPATH, O_RDONLY);
157-
struct papr_location_code lc;
157+
struct papr_location_code lc = { .str = "", };
158158
int fd;
159159

160160
SKIP_IF_MSG(devfd < 0 && errno == ENOENT,

0 commit comments

Comments
 (0)