diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-04-08 02:57:26 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-04-08 02:57:26 +0000 |
commit | bbfe5cc76c1caf2b1b5fcc22429b420fdec501f8 (patch) | |
tree | 96f1934f62e4c72a1c903e650d612858ae90e9d6 /sys/dev/ic/nvme.c | |
parent | b2ed98c2714b1414dd6b981eb8733a1d7d4a689c (diff) |
A pile of sizes to free(9). In test for a few days in snapshots.
Errors will result in nice clean panic messages so we know what's wrong.
Reviewed by dhill visa natano jsg.
Diffstat (limited to 'sys/dev/ic/nvme.c')
-rw-r--r-- | sys/dev/ic/nvme.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index f90db0ce372..0785fbdadf5 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvme.c,v 1.53 2016/11/15 12:17:42 mpi Exp $ */ +/* $OpenBSD: nvme.c,v 1.54 2017/04/08 02:57:25 deraadt Exp $ */ /* * Copyright (c) 2014 David Gwynne <dlg@openbsd.org> @@ -1220,7 +1220,7 @@ nvme_q_alloc(struct nvme_softc *sc, u_int16_t id, u_int entries, u_int dstrd) free_sq: nvme_dmamem_free(sc, q->q_sq_dmamem); free: - free(q, M_DEVBUF, 0); + free(q, M_DEVBUF, sizeof *q); return (NULL); } @@ -1232,7 +1232,7 @@ nvme_q_free(struct nvme_softc *sc, struct nvme_queue *q) nvme_dmamem_sync(sc, q->q_sq_dmamem, BUS_DMASYNC_POSTWRITE); nvme_dmamem_free(sc, q->q_cq_dmamem); nvme_dmamem_free(sc, q->q_sq_dmamem); - free(q, M_DEVBUF, 0); + free(q, M_DEVBUF, sizeof *q); } int @@ -1299,7 +1299,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, ndm->ndm_map); ndmfree: - free(ndm, M_DEVBUF, 0); + free(ndm, M_DEVBUF, sizeof *ndm); return (NULL); } @@ -1318,6 +1318,6 @@ nvme_dmamem_free(struct nvme_softc *sc, struct nvme_dmamem *ndm) bus_dmamem_unmap(sc->sc_dmat, ndm->ndm_kva, ndm->ndm_size); bus_dmamem_free(sc->sc_dmat, &ndm->ndm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, ndm->ndm_map); - free(ndm, M_DEVBUF, 0); + free(ndm, M_DEVBUF, sizeof *ndm); } |