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 The "available" property requires a var...
details: https://anonhg.NetBSD.org/src/rev/771d1426e7a7
branches: trunk
changeset: 979704:771d1426e7a7
user: nakayama <nakayama%NetBSD.org@localhost>
date: Thu Jan 07 07:40:39 2021 +0000
description:
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).
diffstat:
sys/arch/sparc64/dev/psycho.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (44 lines):
diff -r 3865fb20f11b -r 771d1426e7a7 sys/arch/sparc64/dev/psycho.c
--- a/sys/arch/sparc64/dev/psycho.c Thu Jan 07 00:38:46 2021 +0000
+++ b/sys/arch/sparc64/dev/psycho.c Thu Jan 07 07:40:39 2021 +0000
@@ -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 @@
#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 @@
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 @@
ret:
/* return extent */
- kmem_free(pa, sizeof(*pa));
+ free(pa, M_DEVBUF);
return ex;
}
Home |
Main Index |
Thread Index |
Old Index