Skip to content

Commit 3c379a5

Browse files
hewenliang4Lorenzo Pieralisi
authored andcommitted
tools: PCI: Fix fd leakage
We should close fd before the return of run_test. Fixes: 3f2ed81 ("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]>
1 parent 35a82a3 commit 3c379a5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/pci/pcitest.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static int run_test(struct pci_test *test)
129129
}
130130

131131
fflush(stdout);
132+
close(fd);
132133
return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */
133134
}
134135

0 commit comments

Comments
 (0)