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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 btrfstune.c |    4 ++++
 1 file changed, 4 insertions(+)

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);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux