Source-Changes-HG archive

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

[src/trunk]: src/sys/net Convert to kmem(9)



details:   https://anonhg.NetBSD.org/src/rev/adeaf8075355
branches:  trunk
changeset: 351406:adeaf8075355
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Feb 12 08:51:45 2017 +0000

description:
Convert to kmem(9)

diffstat:

 sys/net/if_tap.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (48 lines):

diff -r a5bbef8c6d96 -r adeaf8075355 sys/net/if_tap.c
--- a/sys/net/if_tap.c  Sun Feb 12 08:47:12 2017 +0000
+++ b/sys/net/if_tap.c  Sun Feb 12 08:51:45 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tap.c,v 1.97 2017/02/12 08:47:12 skrll Exp $        */
+/*     $NetBSD: if_tap.c,v 1.98 2017/02/12 08:51:45 skrll Exp $        */
 
 /*
  *  Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.97 2017/02/12 08:47:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.98 2017/02/12 08:51:45 skrll Exp $");
 
 #if defined(_KERNEL_OPT)
 
@@ -51,7 +51,7 @@
 #include <sys/intr.h>
 #include <sys/kauth.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/module.h>
 #include <sys/mutex.h>
 #include <sys/poll.h>
@@ -670,9 +670,9 @@
 static struct tap_softc *
 tap_clone_creator(int unit)
 {
-       struct cfdata *cf;
+       cfdata_t cf;
 
-       cf = malloc(sizeof(*cf), M_DEVBUF, M_WAITOK);
+       cf = kmem_alloc(sizeof(*cf), KM_SLEEP);
        cf->cf_name = tap_cd.cd_name;
        cf->cf_atname = tap_ca.ca_name;
        if (unit == -1) {
@@ -711,7 +711,7 @@
 
        if ((error = config_detach(dev, 0)) != 0)
                aprint_error_dev(dev, "unable to detach instance\n");
-       free(cf, M_DEVBUF);
+       kmem_free(cf, sizeof(*cf));
 
        return error;
 }



Home | Main Index | Thread Index | Old Index