diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-07-13 23:10:24 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-07-13 23:10:24 +0000 |
commit | 7ed78303cb18e6b98d376eb01f6a79bcf6211a0f (patch) | |
tree | b074a2500bf5c87060c6ac6a7480e99344143a86 /sys/dev/pci/virtio.c | |
parent | eede121c340508412e23b0664274f4a9e38bc272 (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.c | 6 |
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; |