Commit 3c379a59 authored by Hewenliang's avatar Hewenliang Committed by Lorenzo Pieralisi
Browse files

tools: PCI: Fix fd leakage



We should close fd before the return of run_test.

Fixes: 3f2ed813 ("tools: PCI: Add a userspace tool to test PCI endpoint")
Signed-off-by: default avatarHewenliang <hewenliang4@huawei.com>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 35a82a37
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 */
}