summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_tht.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-07-13 23:10:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-07-13 23:10:24 +0000
commit7ed78303cb18e6b98d376eb01f6a79bcf6211a0f (patch)
treeb074a2500bf5c87060c6ac6a7480e99344143a86 /sys/dev/pci/if_tht.c
parenteede121c340508412e23b0664274f4a9e38bc272 (diff)
Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishian
ok tedu
Diffstat (limited to 'sys/dev/pci/if_tht.c')
-rw-r--r--sys/dev/pci/if_tht.c6
1 files changed, 3 insertions, 3 deletions
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 <dlg@openbsd.org>
@@ -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);