summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchl <chl@openbsd.org>2009-02-15 17:13:05 +0000
committerchl <chl@openbsd.org>2009-02-15 17:13:05 +0000
commit49c19c92a5616a8e52d55844ecfe58c68ceb9e6b (patch)
treede19ff6b0a3da7a1af41656e4d596d837de7862b
parentchange M_WAITOK --> M_WAITOK | M_CANFAIL (diff)
downloadwireguard-openbsd-49c19c92a5616a8e52d55844ecfe58c68ceb9e6b.tar.xz
wireguard-openbsd-49c19c92a5616a8e52d55844ecfe58c68ceb9e6b.zip
do not check malloc return value against NULL, as M_WAITOK is used
ok krw@ miod@ (some months ago)
-rw-r--r--sys/dev/wsfont/wsfont.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/dev/wsfont/wsfont.c b/sys/dev/wsfont/wsfont.c
index 9543a043df7..3dee94a58d3 100644
--- a/sys/dev/wsfont/wsfont.c
+++ b/sys/dev/wsfont/wsfont.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsfont.c,v 1.23 2008/06/26 05:42:19 ray Exp $ */
+/* $OpenBSD: wsfont.c,v 1.24 2009/02/15 17:13:05 chl Exp $ */
/* $NetBSD: wsfont.c,v 1.17 2001/02/07 13:59:24 ad Exp $ */
/*-
@@ -297,8 +297,6 @@ wsfont_rotate_internal(struct wsdisplay_font *font)
/* Duplicate the existing font... */
newfont = malloc(sizeof *font, M_DEVBUF, M_WAITOK);
- if (newfont == NULL)
- return (NULL);
bcopy(font, newfont, sizeof *font);
newfont->cookie = NULL;
@@ -307,10 +305,6 @@ wsfont_rotate_internal(struct wsdisplay_font *font)
newstride = (font->fontheight + 7) / 8;
newbits = malloc(newstride * font->fontwidth * font->numchars,
M_DEVBUF, M_WAITOK | M_ZERO);
- if (newbits == NULL) {
- free(newfont, M_DEVBUF);
- return (NULL);
- }
/* Rotate the font a bit at a time. */
for (n = 0; n < font->numchars; n++) {