summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--volumes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/volumes.c b/volumes.c
index da797517..b9ca5502 100644
--- a/volumes.c
+++ b/volumes.c
@@ -162,6 +162,8 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
struct btrfs_device *device;
again:
+ if (!fs_devices)
+ return 0;
while (!list_empty(&fs_devices->devices)) {
device = list_entry(fs_devices->devices.next,
struct btrfs_device, dev_list);