Module Name: src Committed By: jmcneill Date: Sat Feb 1 15:33:48 UTC 2020
Modified Files: src/sys/arch/arm/cortex: gicv3_its.c Log Message: Use kmem_zalloc for its state, fixes possible crash if a driver tries to set affinity before a CPU is online. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/cortex/gicv3_its.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/cortex/gicv3_its.c diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.24 src/sys/arch/arm/cortex/gicv3_its.c:1.25 --- src/sys/arch/arm/cortex/gicv3_its.c:1.24 Fri Jan 17 13:54:47 2020 +++ src/sys/arch/arm/cortex/gicv3_its.c Sat Feb 1 15:33:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: gicv3_its.c,v 1.24 2020/01/17 13:54:47 jmcneill Exp $ */ +/* $NetBSD: gicv3_its.c,v 1.25 2020/02/01 15:33:48 jmcneill Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #define _INTR_PRIVATE #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.24 2020/01/17 13:54:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.25 2020/02/01 15:33:48 jmcneill Exp $"); #include <sys/param.h> #include <sys/kmem.h> @@ -846,7 +846,7 @@ gicv3_its_init(struct gicv3_softc *sc, b if ((typer & GITS_TYPER_Physical) == 0) return ENXIO; - its = kmem_alloc(sizeof(*its), KM_SLEEP); + its = kmem_zalloc(sizeof(*its), KM_SLEEP); its->its_id = its_id; its->its_bst = sc->sc_bst; its->its_bsh = bsh;