diff options
author | Hewenliang <hewenliang4@huawei.com> | 2019-10-26 03:35:55 +0200 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2019-10-29 13:04:18 +0100 |
commit | 3c379a59b4795d7279d38c623e74b9790345a32b (patch) | |
tree | 2a64b58bdc3080eae984d7c64c86af8aaa5554b8 /tools | |
parent | MAINTAINERS: Add Marek and Shimoda-san as R-Car PCIE co-maintainers (diff) | |
download | linux-3c379a59b4795d7279d38c623e74b9790345a32b.tar.xz linux-3c379a59b4795d7279d38c623e74b9790345a32b.zip |
tools: PCI: Fix fd leakage
We should close fd before the return of run_test.
Fixes: 3f2ed8134834 ("tools: PCI: Add a userspace tool to test PCI endpoint")
Signed-off-by: Hewenliang <hewenliang4@huawei.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pci/pcitest.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index cb1e51fcc84e..32b7c6f9043d 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -129,6 +129,7 @@ static int run_test(struct pci_test *test) } fflush(stdout); + close(fd); return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */ } |