From 8f456837b1fba053042852c2b58706cec1ae226e Mon Sep 17 00:00:00 2001 From: Doug Hogan Date: Tue, 9 Dec 2014 07:05:07 +0000 Subject: More malloc() -> mallocarray() in the kernel. ok deraadt@ tedu@ --- sys/dev/usb/udl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/usb/udl.c') diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c index abe5400f833..167648e2cb2 100644 --- a/sys/dev/usb/udl.c +++ b/sys/dev/usb/udl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udl.c,v 1.80 2014/07/12 18:48:52 tedu Exp $ */ +/* $OpenBSD: udl.c,v 1.81 2014/12/09 07:05:06 doug Exp $ */ /* * Copyright (c) 2009 Marcus Glocker @@ -652,7 +652,7 @@ udl_alloc_screen(void *v, const struct wsscreen_descr *type, *curyp = 0; /* allocate character backing store */ - sc->sc_cbs = malloc((sc->sc_ri.ri_rows * sc->sc_ri.ri_cols) * + sc->sc_cbs = mallocarray(sc->sc_ri.ri_rows, sc->sc_ri.ri_cols * sizeof(*sc->sc_cbs), M_DEVBUF, M_NOWAIT|M_ZERO); if (sc->sc_cbs == NULL) { printf("%s: can't allocate mem for character backing store!\n", -- cgit v1.2.3