arm64: Avoid null dereference in its_init_cpu

its_init_cpu() is called from gic_v3_init_secondary(), and its_sc will
be NULL if its did not attach.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2016-04-13 21:00:00 +00:00
parent e52a5f2496
commit 6b580fd720
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297940

View File

@ -565,7 +565,7 @@ its_init_cpu(struct gic_v3_its_softc *sc)
* this function was called during GICv3 secondary initialization.
*/
if (sc == NULL) {
if (device_is_attached(its_sc->dev)) {
if (its_sc != NULL && device_is_attached(its_sc->dev)) {
/*
* XXX ARM64TODO: This is part of the workaround that
* saves ITS software context for further use in