diff options
author | Andre Noll <maan@systemlinux.org> | 2009-06-16 02:48:19 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-06-16 02:48:19 -0400 |
commit | fb5ab4b5d6e16fd5006c9f800d0116f3547cb760 (patch) | |
tree | 0094240e6c361d4e48e67103391dd29895eb5e68 /drivers/md | |
parent | ed7b00380d957ec770b5e90380d012c6062c13cc (diff) |
md: raid0: Fix a memory leak when stopping a raid0 array.
raid0_stop() removes all references to the raid0 configuration but
misses to free the ->devlist buffer.
This patch closes this leak, removes a pointless initialization and
fixes a coding style issue in raid0_stop().
Signed-off-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid0.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 99cee51734e5..0d62ad6df212 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -298,16 +298,15 @@ static int raid0_run(mddev_t *mddev) | |||
298 | return 0; | 298 | return 0; |
299 | } | 299 | } |
300 | 300 | ||
301 | static int raid0_stop (mddev_t *mddev) | 301 | static int raid0_stop(mddev_t *mddev) |
302 | { | 302 | { |
303 | raid0_conf_t *conf = mddev_to_conf(mddev); | 303 | raid0_conf_t *conf = mddev_to_conf(mddev); |
304 | 304 | ||
305 | blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ | 305 | blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ |
306 | kfree(conf->strip_zone); | 306 | kfree(conf->strip_zone); |
307 | conf->strip_zone = NULL; | 307 | kfree(conf->devlist); |
308 | kfree(conf); | 308 | kfree(conf); |
309 | mddev->private = NULL; | 309 | mddev->private = NULL; |
310 | |||
311 | return 0; | 310 | return 0; |
312 | } | 311 | } |
313 | 312 | ||