summaryrefslogtreecommitdiff
path: root/btrfslabel.c
diff options
context:
space:
mode:
Diffstat (limited to 'btrfslabel.c')
-rw-r--r--btrfslabel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/btrfslabel.c b/btrfslabel.c
index da694e1d..bf738024 100644
--- a/btrfslabel.c
+++ b/btrfslabel.c
@@ -55,6 +55,8 @@ static void change_label_unmounted(char *dev, char *nLabel)
* and as read-write.
*/
root = open_ctree(dev, 0, 1);
+ if (!root) /* errors are printed by open_ctree() */
+ return;
trans = btrfs_start_transaction(root, 1);
strncpy(root->fs_info->super_copy.label, nLabel, BTRFS_LABEL_SIZE);