aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/md.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index d557e557ff8f..ac99616f48d4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -816,6 +816,8 @@ void md_rdev_clear(struct md_rdev *rdev)
816 put_page(rdev->bb_page); 816 put_page(rdev->bb_page);
817 rdev->bb_page = NULL; 817 rdev->bb_page = NULL;
818 } 818 }
819 kfree(rdev->badblocks.page);
820 rdev->badblocks.page = NULL;
819} 821}
820EXPORT_SYMBOL_GPL(md_rdev_clear); 822EXPORT_SYMBOL_GPL(md_rdev_clear);
821 823
@@ -2191,9 +2193,7 @@ static void unbind_rdev_from_array(struct md_rdev * rdev)
2191 sysfs_remove_link(&rdev->kobj, "block"); 2193 sysfs_remove_link(&rdev->kobj, "block");
2192 sysfs_put(rdev->sysfs_state); 2194 sysfs_put(rdev->sysfs_state);
2193 rdev->sysfs_state = NULL; 2195 rdev->sysfs_state = NULL;
2194 kfree(rdev->badblocks.page);
2195 rdev->badblocks.count = 0; 2196 rdev->badblocks.count = 0;
2196 rdev->badblocks.page = NULL;
2197 /* We need to delay this, otherwise we can deadlock when 2197 /* We need to delay this, otherwise we can deadlock when
2198 * writing to 'remove' to "dev/state". We also need 2198 * writing to 'remove' to "dev/state". We also need
2199 * to delay it due to rcu usage. 2199 * to delay it due to rcu usage.
@@ -3325,7 +3325,6 @@ abort_free:
3325 if (rdev->bdev) 3325 if (rdev->bdev)
3326 unlock_rdev(rdev); 3326 unlock_rdev(rdev);
3327 md_rdev_clear(rdev); 3327 md_rdev_clear(rdev);
3328 kfree(rdev->badblocks.page);
3329 kfree(rdev); 3328 kfree(rdev);
3330 return ERR_PTR(err); 3329 return ERR_PTR(err);
3331} 3330}