From 7ed78303cb18e6b98d376eb01f6a79bcf6211a0f Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 13 Jul 2014 23:10:24 +0000 Subject: Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishian ok tedu --- sys/dev/pci/if_tht.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/pci/if_tht.c') diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index e8928f84196..75a6824788f 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.127 2014/07/12 18:48:52 tedu Exp $ */ +/* $OpenBSD: if_tht.c,v 1.128 2014/07/13 23:10:23 deraadt Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -1879,8 +1879,8 @@ tht_pkt_alloc(struct tht_softc *sc, struct tht_pkt_list *tpl, int npkts, struct tht_pkt *pkt; int i; - tpl->tpl_pkts = malloc(sizeof(struct tht_pkt) * npkts, M_DEVBUF, - M_WAITOK | M_ZERO); + tpl->tpl_pkts = mallocarray(npkts, sizeof(struct tht_pkt), + M_DEVBUF, M_WAITOK | M_ZERO); TAILQ_INIT(&tpl->tpl_free); TAILQ_INIT(&tpl->tpl_used); -- cgit v1.2.3