Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/wsfont Don't test for failure of malloc(..., M_WAITOK...
details: https://anonhg.NetBSD.org/src/rev/590520f5b5cb
branches: trunk
changeset: 357285:590520f5b5cb
user: maya <maya%NetBSD.org@localhost>
date: Sat Nov 04 08:33:28 2017 +0000
description:
Don't test for failure of malloc(...,M_WAITOK), it cannot fail
diffstat:
sys/dev/wsfont/wsfont.c | 16 ++--------------
1 files changed, 2 insertions(+), 14 deletions(-)
diffs (58 lines):
diff -r 28d72f0b5869 -r 590520f5b5cb sys/dev/wsfont/wsfont.c
--- a/sys/dev/wsfont/wsfont.c Sat Nov 04 08:04:40 2017 +0000
+++ b/sys/dev/wsfont/wsfont.c Sat Nov 04 08:33:28 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsfont.c,v 1.61 2016/11/20 15:55:31 macallan Exp $ */
+/* $NetBSD: wsfont.c,v 1.62 2017/11/04 08:33:28 maya Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsfont.c,v 1.61 2016/11/20 15:55:31 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsfont.c,v 1.62 2017/11/04 08:33:28 maya Exp $");
#include "opt_wsfont.h"
@@ -367,8 +367,6 @@
/* Duplicate the existing font... */
newfont = malloc(sizeof(*font), M_DEVBUF, M_WAITOK);
- if (newfont == NULL)
- return (NULL);
*newfont = *font;
@@ -382,10 +380,6 @@
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++) {
@@ -438,8 +432,6 @@
/* Duplicate the existing font... */
newfont = malloc(sizeof(*font), M_DEVBUF, M_WAITOK);
- if (newfont == NULL)
- return (NULL);
*newfont = *font;
@@ -453,10 +445,6 @@
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++) {
Home |
Main Index |
Thread Index |
Old Index