tools: PCI: Fix fd leakage
commit5.4-rM2-2.2.x-imx-squashed3c379a59b4
upstream. We should close fd before the return of run_test. Fixes:3f2ed81348
("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>
parent
5611345ef3
commit
911e1dcc1b
|
@ -129,6 +129,7 @@ static int run_test(struct pci_test *test)
|
||||||
}
|
}
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
close(fd);
|
||||||
return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */
|
return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue