Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb5ab4b5 authored by Andre Noll's avatar Andre Noll Committed by NeilBrown
Browse files

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: default avatarAndre Noll <maan@systemlinux.org>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent ed7b0038
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -304,10 +304,9 @@ static int raid0_stop (mddev_t *mddev)

	blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
	kfree(conf->strip_zone);
	conf->strip_zone = NULL;
	kfree(conf->devlist);
	kfree(conf);
	mddev->private = NULL;

	return 0;
}