Use M_80211_NODE as malloc type for a 80211 node as rest of net80211

code does, instead of M_DEVBUF.  Fixes panics if KMEMSTATS are enabled.
Also use M_ZERO instead of memset on malloc()'s results.
This commit is contained in:
simonb 2008-01-19 03:45:08 +00:00
parent 230c2072a3
commit 741ec49962
1 changed files with 3 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_wpi.c,v 1.34 2008/01/09 20:15:40 degroote Exp $ */
/* $NetBSD: if_wpi.c,v 1.35 2008/01/19 03:45:08 simonb Exp $ */
/*-
* Copyright (c) 2006, 2007
@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.34 2008/01/09 20:15:40 degroote Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.35 2008/01/19 03:45:08 simonb Exp $");
/*
* Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
@ -790,10 +790,8 @@ wpi_node_alloc(struct ieee80211_node_table *nt __unused)
{
struct wpi_node *wn;
wn = malloc(sizeof (struct wpi_node), M_DEVBUF, M_NOWAIT);
wn = malloc(sizeof (struct wpi_node), M_80211_NODE, M_NOWAIT | M_ZERO);
if (wn != NULL)
memset(wn, 0, sizeof (struct wpi_node));
return (struct ieee80211_node *)wn;
}