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).
This commit is contained in:
nakayama 2021-01-07 07:40:39 +00:00
parent 7d8d33cba8
commit 268efe53aa
1 changed files with 5 additions and 4 deletions

View File

@ -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 *pp, int node, pci_chipset_tag_t pc)
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 *pp, int node, int ss, const char *name)
ret:
/* return extent */
kmem_free(pa, sizeof(*pa));
free(pa, M_DEVBUF);
return ex;
}