Remove a couple of zero length kmem_frees.

It should fix at least one crash when unloading the dtrace module,
possibly many others.
This commit is contained in:
ahoka 2010-04-23 11:39:52 +00:00
parent b96117b0b1
commit 290cdd631e
5 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtrace_subr.c,v 1.3 2010/03/13 22:31:15 christos Exp $ */
/* $NetBSD: dtrace_subr.c,v 1.4 2010/04/23 11:39:53 ahoka Exp $ */
/*
* CDDL HEADER START
@ -110,7 +110,7 @@ dtrace_invop_remove(int (*func)(uintptr_t, uintptr_t *, uintptr_t))
prev->dtih_next = hdlr->dtih_next;
}
kmem_free(hdlr, 0);
kmem_free(hdlr, sizeof (dtrace_invop_hdlr_t));
}
/*ARGSUSED*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtrace_sysctl.c,v 1.2 2010/02/21 01:46:33 darran Exp $ */
/* $NetBSD: dtrace_sysctl.c,v 1.3 2010/04/23 11:39:52 ahoka Exp $ */
/*
* CDDL HEADER START
@ -76,7 +76,7 @@ sysctl_dtrace_providers(SYSCTL_HANDLER_ARGS)
if (p_name != NULL) {
error = sysctl_handle_string(oidp, p_name, len, req);
kmem_free(p_name, 0);
kmem_free(p_name, len);
}
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtrace_unload.c,v 1.2 2010/02/21 01:46:33 darran Exp $ */
/* $NetBSD: dtrace_unload.c,v 1.3 2010/04/23 11:39:52 ahoka Exp $ */
/*
* CDDL HEADER START
@ -92,7 +92,7 @@ dtrace_unload()
vmem_destroy(dtrace_arena);
if (dtrace_toxrange != NULL) {
kmem_free(dtrace_toxrange, 0);
kmem_free(dtrace_toxrange, sizeof (dtrace_toxrange_t *);
dtrace_toxrange = NULL;
dtrace_toxranges = 0;
dtrace_toxranges_max = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtrace_subr.c,v 1.4 2010/03/18 13:45:54 tron Exp $ */
/* $NetBSD: dtrace_subr.c,v 1.5 2010/04/23 11:39:53 ahoka Exp $ */
/*
* CDDL HEADER START
@ -113,7 +113,7 @@ dtrace_invop_remove(int (*func)(uintptr_t, uintptr_t *, uintptr_t))
prev->dtih_next = hdlr->dtih_next;
}
kmem_free(hdlr, 0);
kmem_free(hdlr, sizeof (dtrace_invop_hdlr_t));
}
void

View File

@ -11854,19 +11854,19 @@ dtrace_dof_property(const char *name)
freeenv(p_env);
if (len < sizeof (dof_hdr_t)) {
kmem_free(buf, 0);
kmem_free(buf, len);
dtrace_dof_error(NULL, "truncated header");
return (NULL);
}
if (len < (loadsz = dof->dofh_loadsz)) {
kmem_free(buf, 0);
kmem_free(buf, len);
dtrace_dof_error(NULL, "truncated DOF");
return (NULL);
}
if (loadsz >= dtrace_dof_maxsize) {
kmem_free(buf, 0);
kmem_free(buf, len);
dtrace_dof_error(NULL, "oversized DOF");
return (NULL);
}