summaryrefslogtreecommitdiff
path: root/sys/dev/pci/virtio.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/virtio.c
parenteede121c340508412e23b0664274f4a9e38bc272 (diff)
Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishian
ok tedu
Diffstat (limited to 'sys/dev/pci/virtio.c')
-rw-r--r--sys/dev/pci/virtio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/virtio.c b/sys/dev/pci/virtio.c
index d353b15d401..553a6a7ee66 100644
--- a/sys/dev/pci/virtio.c
+++ b/sys/dev/pci/virtio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: virtio.c,v 1.8 2014/07/12 18:48:52 tedu Exp $ */
+/* $OpenBSD: virtio.c,v 1.9 2014/07/13 23:10:23 deraadt Exp $ */
/* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */
/*
@@ -379,8 +379,8 @@ virtio_alloc_vq(struct virtio_softc *sc,
vq->vq_maxnsegs = maxnsegs;
/* free slot management */
- vq->vq_entries = malloc(sizeof(struct vq_entry)*vq_size,
- M_DEVBUF, M_NOWAIT | M_ZERO);
+ vq->vq_entries = mallocarray(vq_size, sizeof(struct vq_entry),
+ M_DEVBUF, M_NOWAIT | M_ZERO);
if (vq->vq_entries == NULL) {
r = ENOMEM;
goto err;