From f015fe6dedade0efbb0930b9dfc1d03bdfac1da0 Mon Sep 17 00:00:00 2001 From: emaste Date: Wed, 13 Apr 2016 21:00:00 +0000 Subject: [PATCH] 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 --- sys/arm64/arm64/gic_v3_its.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/gic_v3_its.c b/sys/arm64/arm64/gic_v3_its.c index aef6346e6e9b..c830c99cab98 100644 --- a/sys/arm64/arm64/gic_v3_its.c +++ b/sys/arm64/arm64/gic_v3_its.c @@ -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