Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/dev psycho: explicit allocation of memory u...



details:   https://anonhg.NetBSD.org/src/rev/9d41c87b695a
branches:  trunk
changeset: 949264:9d41c87b695a
user:      palle <palle%NetBSD.org@localhost>
date:      Wed Jan 06 20:04:30 2021 +0000

description:
psycho: explicit allocation of memory using kmem(9) instead of using the buffer indirectly allocted in the prom_getprop() function (which is still using malloc(9) for memory allocation

diffstat:

 sys/arch/sparc64/dev/psycho.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 8e30948ee7d9 -r 9d41c87b695a sys/arch/sparc64/dev/psycho.c
--- a/sys/arch/sparc64/dev/psycho.c     Wed Jan 06 18:05:58 2021 +0000
+++ b/sys/arch/sparc64/dev/psycho.c     Wed Jan 06 20:04:30 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: psycho.c,v 1.129 2021/01/04 14:48:51 thorpej Exp $     */
+/*     $NetBSD: psycho.c,v 1.130 2021/01/06 20:04:30 palle Exp $       */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.129 2021/01/04 14:48:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.130 2021/01/06 20:04:30 palle Exp $");
 
 #include "opt_ddb.h"
 
@@ -769,7 +769,7 @@
 static struct extent *
 psycho_alloc_extent(struct psycho_pbm *pp, int node, int ss, const char *name)
 {
-       struct psycho_registers *pa = NULL;
+       struct psycho_registers *pa = kmem_zalloc(sizeof *pa, KM_SLEEP);
        struct psycho_ranges *pr;
        struct extent *ex;
        bus_addr_t baddr, addr;



Home | Main Index | Thread Index | Old Index