]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: fix NULL dereference in have_cpu_die()
authorMark Salter <msalter@redhat.com>
Fri, 24 Mar 2017 13:53:56 +0000 (09:53 -0400)
committerWill Deacon <will.deacon@arm.com>
Thu, 30 Mar 2017 16:14:32 +0000 (17:14 +0100)
commit2e4a84a3e75ef7afe764c4ff5f4badcd2366653d
treea4fb36583f7b7c162d33cf882f250e5e070d7e08
parent04db378bc38419431c40af65242beb366dba35ea
arm64: fix NULL dereference in have_cpu_die()

Commit c92da9cccffc ("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: c92da9cccffc ("arm64: smp: Add function to determine if cpus are stuck in the kernel")
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/smp.c