Module Name:    src
Committed By:   nakayama
Date:           Thu Jan  7 07:40:39 UTC 2021

Modified Files:
        src/sys/arch/sparc64/dev: psycho.c

Log Message:
The "available" property requires a variable length buffer, so
leave free(9) until prom_getprop is changed to use kmem_alloc(9)
instead of malloc(9).


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/sparc64/dev/psycho.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/sparc64/dev/psycho.c
diff -u src/sys/arch/sparc64/dev/psycho.c:1.130 src/sys/arch/sparc64/dev/psycho.c:1.131
--- src/sys/arch/sparc64/dev/psycho.c:1.130	Wed Jan  6 20:04:30 2021
+++ src/sys/arch/sparc64/dev/psycho.c	Thu Jan  7 07:40:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: psycho.c,v 1.130 2021/01/06 20:04:30 palle Exp $	*/
+/*	$NetBSD: psycho.c,v 1.131 2021/01/07 07:40:39 nakayama Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.130 2021/01/06 20:04:30 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.131 2021/01/07 07:40:39 nakayama Exp $");
 
 #include "opt_ddb.h"
 
@@ -81,6 +81,7 @@ int psycho_debug = 0x0;
 #include <sys/device.h>
 #include <sys/errno.h>
 #include <sys/extent.h>
+#include <sys/malloc.h>
 #include <sys/kmem.h>
 #include <sys/systm.h>
 #include <sys/time.h>
@@ -769,7 +770,7 @@ psycho_alloc_chipset(struct psycho_pbm *
 static struct extent *
 psycho_alloc_extent(struct psycho_pbm *pp, int node, int ss, const char *name)
 {
-	struct psycho_registers *pa = kmem_zalloc(sizeof *pa, KM_SLEEP);
+	struct psycho_registers *pa = NULL;
 	struct psycho_ranges *pr;
 	struct extent *ex;
 	bus_addr_t baddr, addr;
@@ -833,7 +834,7 @@ psycho_alloc_extent(struct psycho_pbm *p
 
 ret:
 	/* return extent */
-	kmem_free(pa, sizeof(*pa));
+	free(pa, M_DEVBUF);
 	return ex;
 }
 

Reply via email to