From: Anand Jain Date: Wed, 13 Aug 2014 06:24:23 +0000 (+0800) Subject: btrfs: fix memory leak when there is no more seed device X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8bef8401a04ae1937f3330484c2d7a8c6b9b9897;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git btrfs: fix memory leak when there is no more seed device When we replace all the seed device in the system there is no point in just keeping the btrfs_fs_devices with out any device Signed-off-by: Anand Jain Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 27a14f1c5a7c..94a0d186de4c 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1868,6 +1868,8 @@ void btrfs_rm_dev_replace_srcdev(struct btrfs_fs_info *fs_info, tmp_fs_devices = tmp_fs_devices->seed; } fs_devices->seed = NULL; + __btrfs_close_devices(fs_devices); + free_fs_devices(fs_devices); } }