From 9429b8fb440280ccc4058ae9ba9fa3fafe94b8cd Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 11 Jan 2015 02:59:59 +0000 Subject: [PATCH] KUE_MCFILTCNT() is non-constant, so use mallocarray() --- sys/dev/usb/if_kue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index fc4503dd04c..4c8ce7f5da1 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_kue.c,v 1.75 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_kue.c,v 1.76 2015/01/11 02:59:59 deraadt Exp $ */ /* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -463,7 +463,7 @@ kue_attachhook(void *xsc) return; } - sc->kue_mcfilters = malloc(KUE_MCFILTCNT(sc) * ETHER_ADDR_LEN, + sc->kue_mcfilters = mallocarray(KUE_MCFILTCNT(sc), ETHER_ADDR_LEN, M_USBDEV, M_NOWAIT); if (sc->kue_mcfilters == NULL) { printf("%s: no memory for multicast filter buffer\n", -- 2.20.1