From 6cfc29c0027c2e17110ffcef6003d3524451a982 Mon Sep 17 00:00:00 2001 From: mpi Date: Thu, 15 May 2014 09:29:38 +0000 Subject: [PATCH] Use a more appropriate malloc(9) type than M_TEMP for the keymap memory since it is only freed when your keyboard is detached. --- sys/dev/wscons/wskbd.c | 4 ++-- sys/dev/wscons/wskbdutil.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c index cdcf0dedb3b..cc664f29301 100644 --- a/sys/dev/wscons/wskbd.c +++ b/sys/dev/wscons/wskbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wskbd.c,v 1.77 2014/05/05 21:25:00 mpi Exp $ */ +/* $OpenBSD: wskbd.c,v 1.78 2014/05/15 09:29:38 mpi Exp $ */ /* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */ /* @@ -624,7 +624,7 @@ wskbd_detach(struct device *self, int flags) splx(s); } - free(sc->sc_map, M_TEMP); + free(sc->sc_map, M_DEVBUF); /* locate the major number */ for (maj = 0; maj < nchrdev; maj++) diff --git a/sys/dev/wscons/wskbdutil.c b/sys/dev/wscons/wskbdutil.c index 9c83d72e08d..21c771f4e67 100644 --- a/sys/dev/wscons/wskbdutil.c +++ b/sys/dev/wscons/wskbdutil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wskbdutil.c,v 1.11 2014/01/26 17:48:08 miod Exp $ */ +/* $OpenBSD: wskbdutil.c,v 1.12 2014/05/15 09:29:38 mpi Exp $ */ /* $NetBSD: wskbdutil.c,v 1.7 1999/12/21 11:59:13 drochner Exp $ */ /*- @@ -379,10 +379,10 @@ wskbd_init_keymap(int newlen, struct wscons_keymap **map, int *maplen) if (newlen != *maplen) { if (*maplen > 0) - free(*map, M_TEMP); + free(*map, M_DEVBUF); *maplen = newlen; *map = malloc(newlen*sizeof(struct wscons_keymap), - M_TEMP, M_WAITOK); + M_DEVBUF, M_WAITOK); } for (i = 0; i < *maplen; i++) { -- 2.20.1