Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dev/dtrace/aarch64 sizeof(*var) instead ...



details:   https://anonhg.NetBSD.org/src/rev/afc6d7bd0234
branches:  trunk
changeset: 961018:afc6d7bd0234
user:      simonb <simonb%NetBSD.org@localhost>
date:      Tue Apr 06 12:48:36 2021 +0000

description:
sizeof(*var) instead of sizeof(type)
Call kmem_free() with size of data being freed.

diffstat:

 external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 43331dc5f742 -r afc6d7bd0234 external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c
--- a/external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c      Tue Apr 06 12:32:39 2021 +0000
+++ b/external/cddl/osnet/dev/dtrace/aarch64/dtrace_subr.c      Tue Apr 06 12:48:36 2021 +0000
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dtrace_subr.c,v 1.4 2020/11/12 02:15:56 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtrace_subr.c,v 1.5 2021/04/06 12:48:36 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -87,7 +87,7 @@
 {
        dtrace_invop_hdlr_t *hdlr;
 
-       hdlr = kmem_alloc(sizeof (dtrace_invop_hdlr_t), KM_SLEEP);
+       hdlr = kmem_alloc(sizeof(*hdlr), KM_SLEEP);
        hdlr->dtih_func = func;
        hdlr->dtih_next = dtrace_invop_hdlr;
        dtrace_invop_hdlr = hdlr;
@@ -120,7 +120,7 @@
                prev->dtih_next = hdlr->dtih_next;
        }
 
-       kmem_free(hdlr, 0);
+       kmem_free(hdlr, sizeof(*hdlr));
 }
 
 /*ARGSUSED*/



Home | Main Index | Thread Index | Old Index