tools: PCI: Fix fd leakage
authorHewenliang <hewenliang4@huawei.com>
Sat, 26 Oct 2019 01:35:55 +0000 (21:35 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 18:48:54 +0000 (19:48 +0100)
commit911e1dcc1b1bf2cbaecc815dff95406173019931
tree233581e2bed4ed2d6371a83a95e22de56f2f3051
parent5611345ef38fb69a7eaeb1d1699799a6251cb374
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>
tools/pci/pcitest.c