Source-Changes-HG archive

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

[src/trunk]: src/sys/net Use kmem_zalloc to allocate pppoe_softc



details:   https://anonhg.NetBSD.org/src/rev/48366d413aee
branches:  trunk
changeset: 378530:48366d413aee
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Fri Apr 16 01:32:04 2021 +0000

description:
Use kmem_zalloc to allocate pppoe_softc

diffstat:

 sys/net/if_pppoe.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 4e77f151b24c -r 48366d413aee sys/net/if_pppoe.c
--- a/sys/net/if_pppoe.c        Fri Apr 16 01:28:51 2021 +0000
+++ b/sys/net/if_pppoe.c        Fri Apr 16 01:32:04 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.164 2021/04/16 01:28:51 yamaguchi Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.165 2021/04/16 01:32:04 yamaguchi Exp $ */
 
 /*
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.164 2021/04/16 01:28:51 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.165 2021/04/16 01:32:04 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -341,7 +341,7 @@ pppoe_clone_create(struct if_clone *ifc,
        struct pppoe_softc *sc;
        int rv;
 
-       sc = malloc(sizeof(struct pppoe_softc), M_DEVBUF, M_WAITOK|M_ZERO);
+       sc = kmem_zalloc(sizeof(*sc), KM_SLEEP);
 
        rw_init(&sc->sc_lock);
        pppoe_softc_genid(&sc->sc_id);
@@ -408,7 +408,7 @@ destroy_timeout:
        workqueue_destroy(sc->sc_timeout_wq);
 destroy_sclock:
        rw_destroy(&sc->sc_lock);
-       free(sc, M_DEVBUF);
+       kmem_free(sc, sizeof(*sc));
 
        return rv;
 }
@@ -449,7 +449,7 @@ pppoe_clone_destroy(struct ifnet *ifp)
        PPPOE_UNLOCK(sc);
        rw_destroy(&sc->sc_lock);
 
-       free(sc, M_DEVBUF);
+       kmem_free(sc, sizeof(*sc));
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index