From 1d034e68e2c256640eb1f44bd7dcd89f90806ccf Mon Sep 17 00:00:00 2001 From: Anna-Maria Gleixner Date: Wed, 16 Mar 2016 09:25:23 +0100 Subject: md/raid5: Cleanup cpu hotplug notifier The raid456_cpu_notify() hotplug callback lacks handling of the CPU_UP_CANCELED case. That means if CPU_UP_PREPARE fails, the scratch buffer is leaked. Add handling for CPU_UP_CANCELED[_FROZEN] hotplug notifier transitions to free the scratch buffer. CC: Shaohua Li CC: linux-raid@vger.kernel.org Signed-off-by: Anna-Maria Gleixner Signed-off-by: Shaohua Li --- drivers/md/raid5.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/md') diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 31ac0f0bf86f..8ab8b65e1741 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -6381,6 +6381,8 @@ static int raid456_cpu_notify(struct notifier_block *nfb, unsigned long action, break; case CPU_DEAD: case CPU_DEAD_FROZEN: + case CPU_UP_CANCELED: + case CPU_UP_CANCELED_FROZEN: free_scratch_buffer(conf, per_cpu_ptr(conf->percpu, cpu)); break; default: -- cgit v1.2.3