summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaya <maya@NetBSD.org>2017-11-03 18:49:37 +0000
committermaya <maya@NetBSD.org>2017-11-03 18:49:37 +0000
commit2e324bd9621ea4d321a117208b4cfc19bff1789b (patch)
tree7b8df8149250ff0d1aacd19803d0664414fe0807
parentfbdb94630c48230ba593a833b7fa28c0388f5897 (diff)
Use M_WAITOK if we aren't going to check for NULL before dereferencing
Same function already uses M_WAITOK unconditionally, so this is a safe change While here, drop null check of M_WAITOK. it shouldn't fail.
-rw-r--r--sys/dev/wscons/wsdisplay.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index 780c4e048ff..24257253f6b 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.142 2017/05/19 19:22:33 macallan Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.143 2017/11/03 18:49:37 maya Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.142 2017/05/19 19:22:33 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.143 2017/11/03 18:49:37 maya Exp $");
#ifdef _KERNEL_OPT
#include "opt_wsdisplay_compat.h"
@@ -271,8 +271,6 @@ wsscreen_attach(struct wsdisplay_softc *sc, int console, const char *emul,
struct wsscreen *scr;
scr = malloc(sizeof(struct wsscreen), M_DEVBUF, M_WAITOK);
- if (!scr)
- return (NULL);
if (console) {
dconf = &wsdisplay_console_conf;
@@ -284,7 +282,7 @@ wsscreen_attach(struct wsdisplay_softc *sc, int console, const char *emul,
(*dconf->wsemul->attach)(1, 0, 0, 0, 0, scr, 0);
} else { /* not console */
dconf = malloc(sizeof(struct wsscreen_internal),
- M_DEVBUF, M_NOWAIT);
+ M_DEVBUF, M_WAITOK);
dconf->emulops = type->textops;
dconf->emulcookie = cookie;
if (dconf->emulops) {