Skip to content

Commit 224d803

Browse files
yangshunyongLorenzo Pieralisi
authored andcommitted
tools: PCI: Zero-initialize param
The values in param may be random if they are not initialized, which may cause use_dma flag set even when "-d" option is not provided in command line. Initializing all members to 0 to solve this. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Shunyong Yang <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Kishon Vijay Abraham I <[email protected]>
1 parent e73f0f0 commit 224d803

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/pci/pcitest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct pci_test {
4040

4141
static int run_test(struct pci_test *test)
4242
{
43-
struct pci_endpoint_test_xfer_param param;
43+
struct pci_endpoint_test_xfer_param param = {};
4444
int ret = -EINVAL;
4545
int fd;
4646

0 commit comments

Comments
 (0)