mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 12:52:29 -04:00
powerpc/smp: add NULL guard for cause_ipi in smp_muxed_ipi_message_pass
smp_muxed_ipi_message_pass() calls smp_ops->cause_ipi() without
checking whether it has been set.
On platforms using muxed IPI (e.g. powernv/pseries), smp_ops->cause_ipi
is initialized to NULL in the static smp_ops and only assigned during
the platform smp_probe() handler. If the IPI subsystem fails to
initialize -- for example when xive_init_ipis() fails and
xive_smp_probe() returns an error -- the probe handler returns early
and cause_ipi is never set. Any subsequent IPI send (e.g.
arch_smp_send_reschedule()) would dereference the NULL pointer.
Add a NULL check to avoid the crash in that situation.
Fixes: 23d72bfd8f ("powerpc: Consolidate ipi message mux and demux")
Signed-off-by: Gou Hao <gouhao@uniontech.com>
Reviewed-by: jiazhenyuan <jiazhenyuan@uniontech.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260727104215.184786-6-gouhao@uniontech.com
This commit is contained in:
committed by
Madhavan Srinivasan
parent
37d401c9c4
commit
5aabc19270
@@ -289,6 +289,9 @@ void smp_muxed_ipi_set_message(int cpu, int msg)
|
||||
|
||||
void smp_muxed_ipi_message_pass(int cpu, int msg)
|
||||
{
|
||||
if (!smp_ops->cause_ipi)
|
||||
return;
|
||||
|
||||
smp_muxed_ipi_set_message(cpu, msg);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user