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:
emaste 2016-04-13 21:00:00 +00:00
parent 2b5f6fc5bf
commit f015fe6ded

View File

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