• Mark Salter's avatar
    arm64: fix NULL dereference in have_cpu_die() · 335d2c2d
    Mark Salter authored
    Commit 5c492c3f ("arm64: smp: Add function to determine if cpus are
    stuck in the kernel") added a helper function to determine if die() is
    supported in cpu_ops. This function assumes a cpu will have a valid
    cpu_ops entry, but that may not be the case for cpu0 is spin-table or
    parking protocol is used to boot secondary cpus. In that case, there
    is a NULL dereference if have_cpu_die() is called by cpu0. So add a
    check for a valid cpu_ops before dereferencing it.
    
    Fixes: 5c492c3f ("arm64: smp: Add function to determine if cpus are stuck in the kernel")
    Signed-off-by: default avatarMark Salter <msalter@redhat.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    335d2c2d
smp.c 21.6 KB