tools: PCI: Zero-initialize param
PATCH v2 1/1 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.
---
v2: Change {0} to {} as Leon Romanovsky's comment.
--- tools/pci/pcitest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/pci/pcitest.c +1 -1
@@ -40,7 +40,7 @@ struct pci_test {static int run_test (struct pci_test *test) { -struct pci_endpoint_test_xfer_param param; +struct pci_endpoint_test_xfer_param param = {};int ret = -EINVAL ;int fd;
Signature · 1 line
2.25.1
Quoted 5 lines · Shunyong Yang
The values in param may be random if they are not initialized, which may cause
use_dmaflag set even when "-d" option is not provided in command line. Initializing all members to 0 to solve this.Signed-off-by Shunyong Yang <[email protected]>
Thanks for the fix.
Quoted 20 lines
---
v2: Change {0} to {} as Leon Romanovsky's comment.--- tools/pci/pcitest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/pci/pcitest.c +1
-1@@ -40,7 +40,7 @@ struct pci_test {static int run_test (struct pci_test *test) { -struct pci_endpoint_test_xfer_param param; +struct pci_endpoint_test_xfer_param param = {};int ret = -EINVAL ;int fd;
Hi, Bjorn,
Would you please help to review and put this tiny fix (for tools/pci/pcitest.c) in your merge queue? Kishon has acked.
Thanks.
Shunyong
Quoted 32 lines · Kishon Vijay Abraham I
Quoted 5 lines · Shunyong Yang
The values in param may be random if they are not initialized, which may cause
use_dmaflag set even when "-d" option is not provided in command line. Initializing all members to 0 to solve this.Signed-off-by Shunyong Yang <[email protected]>Thanks for the fix.
Quoted 20 lines
---
v2: Change {0} to {} as Leon Romanovsky's comment.--- tools/pci/pcitest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/pci/pcitest.c +1
-1@@ -40,7 +40,7 @@ struct pci_test {static int run_test (struct pci_test *test) { -struct pci_endpoint_test_xfer_param param; +struct pci_endpoint_test_xfer_param param = {};int ret = -EINVAL ;int fd;
Lorenzo Pieralisi
AppliedQuoted 3 lines · Shunyong Yang
The values in param may be random if they are not initialized, which may cause
use_dmaflag set even when "-d" option is not provided in command line. Initializing all members to 0 to solve this.
Applied to pci/tools, thanks!
[1/1] tools: PCI: Zero-initialize param
https://git.kernel.org/lpieralisi/pci/c/224d8031e4
Thanks,
Lorenzo