]> Git Repo - linux.git/commitdiff
tools: PCI: Fix fd leakage
authorHewenliang <[email protected]>
Sat, 26 Oct 2019 01:35:55 +0000 (21:35 -0400)
committerLorenzo Pieralisi <[email protected]>
Tue, 29 Oct 2019 12:04:18 +0000 (12:04 +0000)
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 <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Acked-by: Kishon Vijay Abraham I <[email protected]>
tools/pci/pcitest.c

index cb1e51fcc84e0b09d51400011ea9d28ebb4ab795..32b7c6f9043ddfc05d71510e67a92b856dbd14cc 100644 (file)
@@ -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 */
 }
 
This page took 0.057261 seconds and 4 git commands to generate.