From f8d0d5dc641cd405ad40cb2498b04df9716baee6 Mon Sep 17 00:00:00 2001 From: Santosh Sivaraj Date: Tue, 27 Jun 2017 12:30:05 +0530 Subject: powerpc/smp: Do not BUG_ON if invalid CPU during kick During secondary start, we do not need to BUG_ON if an invalid CPU number is passed. We already print an error if secondary cannot be started, so just return an error instead. Signed-off-by: Santosh Sivaraj Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/powerpc/kernel') diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index df2a41647d8e..05bf5836107c 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -112,7 +112,8 @@ int smp_generic_cpu_bootable(unsigned int nr) #ifdef CONFIG_PPC64 int smp_generic_kick_cpu(int nr) { - BUG_ON(nr < 0 || nr >= NR_CPUS); + if (nr < 0 || nr >= NR_CPUS) + return -EINVAL; /* * The processor is currently spinning, waiting for the -- cgit v1.2.3-55-g7522