Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci PR/50636: Ryo ONODERA: Fix incorrect kmem_free()



details:   https://anonhg.NetBSD.org/src/rev/3ae9bf77dfe5
branches:  trunk
changeset: 812960:3ae9bf77dfe5
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 10 03:07:25 2016 +0000

description:
PR/50636: Ryo ONODERA: Fix incorrect kmem_free()

diffstat:

 sys/dev/pci/virtio.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r abad6d5f273f -r 3ae9bf77dfe5 sys/dev/pci/virtio.c
--- a/sys/dev/pci/virtio.c      Sun Jan 10 02:40:21 2016 +0000
+++ b/sys/dev/pci/virtio.c      Sun Jan 10 03:07:25 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: virtio.c,v 1.13 2015/10/30 20:38:31 christos Exp $     */
+/*     $NetBSD: virtio.c,v 1.14 2016/01/10 03:07:25 christos Exp $     */
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.13 2015/10/30 20:38:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.14 2016/01/10 03:07:25 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -942,7 +942,7 @@
        bus_space_write_4(sc->sc_iot, sc->sc_ioh,
                          VIRTIO_CONFIG_QUEUE_ADDRESS, 0);
 
-       kmem_free(vq->vq_entries, vq->vq_bytesize);
+       kmem_free(vq->vq_entries, sizeof(*vq->vq_entries) * vq->vq_num);
        bus_dmamap_unload(sc->sc_dmat, vq->vq_dmamap);
        bus_dmamap_destroy(sc->sc_dmat, vq->vq_dmamap);
        bus_dmamem_unmap(sc->sc_dmat, vq->vq_vaddr, vq->vq_bytesize);



Home | Main Index | Thread Index | Old Index