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

Commit c4796e21 authored by NeilBrown's avatar NeilBrown
Browse files

md/raid10: another memory leak due to reshape.



Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 3fd83717
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -3834,6 +3834,8 @@ static int stop(struct mddev *mddev)
		mempool_destroy(conf->r10bio_pool);
		mempool_destroy(conf->r10bio_pool);
	safe_put_page(conf->tmppage);
	safe_put_page(conf->tmppage);
	kfree(conf->mirrors);
	kfree(conf->mirrors);
	kfree(conf->mirrors_old);
	kfree(conf->mirrors_new);
	kfree(conf);
	kfree(conf);
	mddev->private = NULL;
	mddev->private = NULL;
	return 0;
	return 0;
@@ -4121,7 +4123,7 @@ static int raid10_start_reshape(struct mddev *mddev)
		memcpy(conf->mirrors_new, conf->mirrors,
		memcpy(conf->mirrors_new, conf->mirrors,
		       sizeof(struct raid10_info)*conf->prev.raid_disks);
		       sizeof(struct raid10_info)*conf->prev.raid_disks);
		smp_mb();
		smp_mb();
		kfree(conf->mirrors_old); /* FIXME and elsewhere */
		kfree(conf->mirrors_old);
		conf->mirrors_old = conf->mirrors;
		conf->mirrors_old = conf->mirrors;
		conf->mirrors = conf->mirrors_new;
		conf->mirrors = conf->mirrors_new;
		conf->mirrors_new = NULL;
		conf->mirrors_new = NULL;