Skip to content

Commit

Permalink
selftests/powerpc/papr-vpd: Fix missing variable initialization
Browse files Browse the repository at this point in the history
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: 9118c5d ("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
  • Loading branch information
Nathan Lynch authored and Michael Ellerman committed Apr 12, 2024
1 parent 6963092 commit 210cfef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 210cfef

Please sign in to comment.