diff mbox

[ndctl] ndctl, test: fix check_btt_autodetect() exit condition

Message ID 149971890518.36155.4733103499126457965.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit 15503084bfd8
Headers show

Commit Message

Dan Williams July 10, 2017, 8:35 p.m. UTC
Static analysis reports that we fail to act on a pwrite() error
initializing the info block to zero.

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

Patch

diff --git a/test/libndctl.c b/test/libndctl.c
index e1c8ee9aabf8..9c9263930554 100644
--- a/test/libndctl.c
+++ b/test/libndctl.c
@@ -1534,6 +1534,7 @@  static int check_btt_autodetect(struct ndctl_bus *bus,
 		rc = -ENXIO;
 		fprintf(stderr, "%s: failed to overwrite btt on %s\n",
 				devname, bdev);
+		goto out;
 	}
 	rc = pwrite(fd, buf, 4096, 0);
 	if (rc < 4096) {