Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966352AbcCPI0J (ORCPT ); Wed, 16 Mar 2016 04:26:09 -0400 Received: from www.linutronix.de ([62.245.132.108]:53937 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966165AbcCPIZw (ORCPT ); Wed, 16 Mar 2016 04:25:52 -0400 From: Anna-Maria Gleixner To: linux-kernel@vger.kernel.org Cc: rt@linutronix.de, Anna-Maria Gleixner , Shaohua Li , linux-raid@vger.kernel.org Subject: [PATCH] md/raid5: Cleanup cpu hotplug notifier Date: Wed, 16 Mar 2016 09:25:23 +0100 Message-Id: <1458116723-66984-1-git-send-email-anna-maria@linutronix.de> X-Mailer: git-send-email 2.7.0 X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 749 Lines: 25 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 --- drivers/md/raid5.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -6376,6 +6376,8 @@ static int raid456_cpu_notify(struct not 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: