diff options
author | Hewenliang <hewenliang4@huawei.com> | 2019-10-26 04:35:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-17 21:48:54 +0300 |
commit | 911e1dcc1b1bf2cbaecc815dff95406173019931 (patch) | |
tree | 233581e2bed4ed2d6371a83a95e22de56f2f3051 | |
parent | 5611345ef38fb69a7eaeb1d1699799a6251cb374 (diff) | |
download | linux-911e1dcc1b1bf2cbaecc815dff95406173019931.tar.xz |
tools: PCI: Fix fd leakage
commit 3c379a59b4795d7279d38c623e74b9790345a32b upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 */ } |