diff mbox

ndctl: fix double close in check_btt_autodetect

Message ID 20151016172316.35267.76370.stgit@dwillia2-desk3.jf.intel.com (mailing list archive)
State Accepted
Commit 278333f292af
Headers show

Commit Message

Dan Williams Oct. 16, 2015, 5:23 p.m. UTC
The recent leak fix, commit eb125ae77788 "ndctl: fix 'fd' leak in
check_btt_autodetect", introduced a potential double-close in this test.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 lib/test-libndctl.c |    1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/lib/test-libndctl.c b/lib/test-libndctl.c
index 821065993dd7..b0221335606e 100644
--- a/lib/test-libndctl.c
+++ b/lib/test-libndctl.c
@@ -722,6 +722,7 @@  static int check_btt_autodetect(struct ndctl_bus *bus,
 		goto out;
 	}
 	close(fd);
+	fd = -1;
 
 	rc = -ENXIO;
 	if (ro != namespace->ro) {