summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2019-12-19 10:15:22 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2019-12-19 10:15:22 +0000
commit2c122dfca1e93c23d49f2782552a59cad4d32daa (patch)
tree0c4deb2072d3f63260f0e561df9e57b9445c8c5f
parent50ca19e8e7b782ab8454620163d10e66a3f9574f (diff)
Add size for free() in vio(4).
There is an existing allocsize variable tracking size of allocations, turns out we can pass it to free in the error path. OK florian@, mpi@
-rw-r--r--sys/dev/pv/if_vio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pv/if_vio.c b/sys/dev/pv/if_vio.c
index 84d55907594..242b8b0ed69 100644
--- a/sys/dev/pv/if_vio.c
+++ b/sys/dev/pv/if_vio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vio.c,v 1.14 2019/10/25 07:13:54 claudio Exp $ */
+/* $OpenBSD: if_vio.c,v 1.15 2019/12/19 10:15:21 fcambus Exp $ */
/*
* Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg.
@@ -482,7 +482,7 @@ err_reqs:
bus_dmamap_destroy(vsc->sc_dmat, sc->sc_rx_dmamaps[i]);
}
if (sc->sc_arrays) {
- free(sc->sc_arrays, M_DEVBUF, 0);
+ free(sc->sc_arrays, M_DEVBUF, allocsize);
sc->sc_arrays = 0;
}
err_hdr: