diff options
author | David Sterba <dsterba@suse.com> | 2016-10-03 16:48:53 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-10-05 12:39:01 +0200 |
commit | ea0fd88b5a443947aab2162b59d06b3f6f6e1649 (patch) | |
tree | 91579e583921e1bbece1f71b932e36cc1cc30c81 /volumes.c | |
parent | 61d5425fd3a089c6ffbad62b145f1a06c21ff860 (diff) |
btrfs-progs: don't access freed memory in btrfs_close_devices
Caught by ASAN, as we don't access fs_devices directly, there's no null
deref but 0x30 is still wrong.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'volumes.c')
-rw-r--r-- | volumes.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |