Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/isa malloc() -> kmem_alloc()



details:   https://anonhg.NetBSD.org/src/rev/020bff8a16f2
branches:  trunk
changeset: 370104:020bff8a16f2
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Sep 17 16:42:38 2022 +0000

description:
malloc() -> kmem_alloc()

diffstat:

 sys/dev/isa/if_eg.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (42 lines):

diff -r 7bda5ae929ba -r 020bff8a16f2 sys/dev/isa/if_eg.c
--- a/sys/dev/isa/if_eg.c       Sat Sep 17 15:44:15 2022 +0000
+++ b/sys/dev/isa/if_eg.c       Sat Sep 17 16:42:38 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_eg.c,v 1.97 2020/01/29 06:21:40 thorpej Exp $       */
+/*     $NetBSD: if_eg.c,v 1.98 2022/09/17 16:42:38 thorpej Exp $       */
 
 /*
  * Copyright (c) 1993 Dean Huxley <dean%fsa.ca@localhost>
@@ -40,12 +40,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_eg.c,v 1.97 2020/01/29 06:21:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_eg.c,v 1.98 2022/09/17 16:42:38 thorpej Exp $");
 
 #include "opt_inet.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/kmem.h>
 #include <sys/mbuf.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
@@ -496,7 +497,7 @@
                aprint_error_dev(sc->sc_dev,"configure card command failed\n");
 
        if (sc->eg_inbuf == NULL) {
-               sc->eg_inbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT);
+               sc->eg_inbuf = kmem_alloc(EG_BUFLEN, KM_NOSLEEP);
                if (sc->eg_inbuf == NULL) {
                        aprint_error_dev(sc->sc_dev, "can't allocate inbuf\n");
                        panic("eginit");
@@ -505,7 +506,7 @@
        sc->eg_incount = 0;
 
        if (sc->eg_outbuf == NULL) {
-               sc->eg_outbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT);
+               sc->eg_outbuf = kmem_alloc(EG_BUFLEN, KM_NOSLEEP);
                if (sc->eg_outbuf == NULL) {
                        aprint_error_dev(sc->sc_dev,"can't allocate outbuf\n");
                        panic("eginit");



Home | Main Index | Thread Index | Old Index