Subject: + kernel-smpc-free-related-resources-when-failure-occurs-in-hotplug_cfd.patch added to -mm tree To: gang.chen@xxxxxxxxxxx,udknight@xxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 09 Jul 2013 15:01:32 -0700 The patch titled Subject: kernel/smp.c: free related resources when failure occurs in hotplug_cfd() has been added to the -mm tree. Its filename is kernel-smpc-free-related-resources-when-failure-occurs-in-hotplug_cfd.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/kernel-smpc-free-related-resources-when-failure-occurs-in-hotplug_cfd.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/kernel-smpc-free-related-resources-when-failure-occurs-in-hotplug_cfd.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Chen Gang <gang.chen@xxxxxxxxxxx> Subject: kernel/smp.c: free related resources when failure occurs in hotplug_cfd() When failure occurs in hotplug_cfd(), need release related resources, or will cause memory leak. Signed-off-by: Chen Gang <gang.chen@xxxxxxxxxxx> Acked-by: Wang YanQing <udknight@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/smp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff -puN kernel/smp.c~kernel-smpc-free-related-resources-when-failure-occurs-in-hotplug_cfd kernel/smp.c --- a/kernel/smp.c~kernel-smpc-free-related-resources-when-failure-occurs-in-hotplug_cfd +++ a/kernel/smp.c @@ -48,10 +48,13 @@ hotplug_cfd(struct notifier_block *nfb, cpu_to_node(cpu))) return notifier_from_errno(-ENOMEM); if (!zalloc_cpumask_var_node(&cfd->cpumask_ipi, GFP_KERNEL, - cpu_to_node(cpu))) + cpu_to_node(cpu))) { + free_cpumask_var(cfd->cpumask); return notifier_from_errno(-ENOMEM); + } cfd->csd = alloc_percpu(struct call_single_data); if (!cfd->csd) { + free_cpumask_var(cfd->cpumask_ipi); free_cpumask_var(cfd->cpumask); return notifier_from_errno(-ENOMEM); } _ Patches currently in -mm which might be from gang.chen@xxxxxxxxxxx are origin.patch kernel-auditfilterc-fix-leak-in-audit_add_rule-error-path.patch linux-next.patch include-linux-interrupth-add-dummy-irq_set_irq_wake-for-generic_hardirqs.patch kernel-smpc-free-related-resources-when-failure-occurs-in-hotplug_cfd.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html