md/raid6: release spare page at ->stop()

Add missing call to safe_put_page from stop() by unifying open coded
raid5_conf_t de-allocation under free_conf().

Cc: <stable@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>

authored by Dan Williams and committed by NeilBrown 95fc17aa 7d3e91b8

+12 -14
+12 -14
drivers/md/raid5.c
··· 4316 4316 return sectors * (raid_disks - conf->max_degraded); 4317 4317 } 4318 4318 4319 + static void free_conf(raid5_conf_t *conf) 4320 + { 4321 + shrink_stripes(conf); 4322 + safe_put_page(conf->spare_page); 4323 + kfree(conf->disks); 4324 + kfree(conf->stripe_hashtbl); 4325 + kfree(conf); 4326 + } 4327 + 4319 4328 static raid5_conf_t *setup_conf(mddev_t *mddev) 4320 4329 { 4321 4330 raid5_conf_t *conf; ··· 4456 4447 4457 4448 abort: 4458 4449 if (conf) { 4459 - shrink_stripes(conf); 4460 - safe_put_page(conf->spare_page); 4461 - kfree(conf->disks); 4462 - kfree(conf->stripe_hashtbl); 4463 - kfree(conf); 4450 + free_conf(conf); 4464 4451 return ERR_PTR(-EIO); 4465 4452 } else 4466 4453 return ERR_PTR(-ENOMEM); ··· 4634 4629 md_unregister_thread(mddev->thread); 4635 4630 mddev->thread = NULL; 4636 4631 if (conf) { 4637 - shrink_stripes(conf); 4638 4632 print_raid5_conf(conf); 4639 - safe_put_page(conf->spare_page); 4640 - kfree(conf->disks); 4641 - kfree(conf->stripe_hashtbl); 4642 - kfree(conf); 4633 + free_conf(conf); 4643 4634 } 4644 4635 mddev->private = NULL; 4645 4636 printk(KERN_ALERT "raid5: failed to run raid set %s\n", mdname(mddev)); ··· 4650 4649 4651 4650 md_unregister_thread(mddev->thread); 4652 4651 mddev->thread = NULL; 4653 - shrink_stripes(conf); 4654 - kfree(conf->stripe_hashtbl); 4655 4652 mddev->queue->backing_dev_info.congested_fn = NULL; 4656 4653 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ 4657 4654 sysfs_remove_group(&mddev->kobj, &raid5_attrs_group); 4658 - kfree(conf->disks); 4659 - kfree(conf); 4655 + free_conf(conf); 4660 4656 mddev->private = NULL; 4661 4657 return 0; 4662 4658 }