diff mbox

Check for failure in open_ctree() call. (LP: #926186)

Message ID 1341275126-17671-1-git-send-email-shawnlandden@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shawn Landden July 3, 2012, 12:25 a.m. UTC
---
 btrfstune.c |    4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/btrfstune.c b/btrfstune.c
index 47830c5..f746e14 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -107,6 +107,10 @@  int main(int argc, char *argv[])
 	}
 
 	root = open_ctree(device, 0, 1);
+	if (!root) {
+		fprintf(stderr, "unable to open ctree\n");
+		return 1;
+        }
 
 	if (seeding_flag) {
 		ret = update_seeding_flag(root, seeding_value);