diff options
author | 2015-09-08 10:21:50 +0000 | |
---|---|---|
committer | 2015-09-08 10:21:50 +0000 | |
commit | 36664874f8f73efc97d82f9286f86637e04332ee (patch) | |
tree | e77d4b2a4193b29752a451156e4245b495cfd5fb | |
parent | sizes for free(); ok semarie (diff) | |
download | wireguard-openbsd-36664874f8f73efc97d82f9286f86637e04332ee.tar.xz wireguard-openbsd-36664874f8f73efc97d82f9286f86637e04332ee.zip |
sizes for free(); ok semarie
-rw-r--r-- | sys/arch/sgi/dev/impact.c | 4 | ||||
-rw-r--r-- | sys/arch/sgi/dev/spdmem_mainbus.c | 6 | ||||
-rw-r--r-- | sys/arch/sgi/gio/grtwo.c | 6 | ||||
-rw-r--r-- | sys/arch/sgi/gio/newport.c | 4 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/eisa_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/ip27_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/l1.c | 8 | ||||
-rw-r--r-- | sys/arch/sgi/xbow/xbridge.c | 6 | ||||
-rw-r--r-- | sys/arch/sgi/xbow/xheart.c | 4 |
9 files changed, 23 insertions, 23 deletions
diff --git a/sys/arch/sgi/dev/impact.c b/sys/arch/sgi/dev/impact.c index dc5481fcbb9..dd589faa3bc 100644 --- a/sys/arch/sgi/dev/impact.c +++ b/sys/arch/sgi/dev/impact.c @@ -1,4 +1,4 @@ -/* $OpenBSD: impact.c,v 1.7 2014/12/13 21:05:32 doug Exp $ */ +/* $OpenBSD: impact.c,v 1.8 2015/09/08 10:21:50 deraadt Exp $ */ /* * Copyright (c) 2010, 2012 Miodrag Vallat. @@ -168,7 +168,7 @@ impact_attach_common(struct impact_softc *sc, bus_space_tag_t iot, impact_setup(scr, has_hq4); if (impact_init_screen(scr) != 0) { printf("failed to allocate memory\n"); - free(scr, M_DEVBUF, 0); + free(scr, M_DEVBUF, sizeof *scr); return ENOMEM; } } diff --git a/sys/arch/sgi/dev/spdmem_mainbus.c b/sys/arch/sgi/dev/spdmem_mainbus.c index 8b6de372241..3d37c202e87 100644 --- a/sys/arch/sgi/dev/spdmem_mainbus.c +++ b/sys/arch/sgi/dev/spdmem_mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spdmem_mainbus.c,v 1.2 2014/07/12 18:44:42 tedu Exp $ */ +/* $OpenBSD: spdmem_mainbus.c,v 1.3 2015/09/08 10:21:50 deraadt Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -66,7 +66,7 @@ spdmem_mainbus_match(struct device *parent, void *vcf, void *aux) rc = l1_get_brick_spd_record(saa->maa.maa_nasid, saa->dimm, &spd, &spdlen); if (rc == 0) { - free(spd, M_DEVBUF, 0); + free(spd, M_DEVBUF, spdlen); return 1; } else return 0; @@ -91,8 +91,8 @@ spdmem_mainbus_attach(struct device *parent, struct device *self, void *aux) sc->sc_base.sc_read = spdmem_mainbus_read; spdmem_attach_common(&sc->sc_base); /* free record, as it won't be accessed anymore */ + free(sc->sc_spd, M_DEVBUF, sc->sc_spdlen); sc->sc_spdlen = 0; - free(sc->sc_spd, M_DEVBUF, 0); } uint8_t diff --git a/sys/arch/sgi/gio/grtwo.c b/sys/arch/sgi/gio/grtwo.c index fd42e7eb2cb..85858afef19 100644 --- a/sys/arch/sgi/gio/grtwo.c +++ b/sys/arch/sgi/gio/grtwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grtwo.c,v 1.11 2014/12/09 06:58:29 doug Exp $ */ +/* $OpenBSD: grtwo.c,v 1.12 2015/09/08 10:21:50 deraadt Exp $ */ /* $NetBSD: grtwo.c,v 1.11 2009/11/22 19:09:15 mbalmer Exp $ */ /* @@ -411,11 +411,11 @@ grtwo_attach(struct device *parent, struct device *self, void *aux) goto out; if (grtwo_attach_common(dc, ga) != 0) { printf("\n%s: not responding\n", self->dv_xname); - free(dc, M_DEVBUF, 0); + free(dc, M_DEVBUF, sizeof *dc); return; } if (grtwo_init_screen(dc, M_WAITOK | M_CANFAIL) != 0) { - free(dc, M_DEVBUF, 0); + free(dc, M_DEVBUF, sizeof *dc); goto out; } #endif diff --git a/sys/arch/sgi/gio/newport.c b/sys/arch/sgi/gio/newport.c index 4e9b5504f3a..36065662f03 100644 --- a/sys/arch/sgi/gio/newport.c +++ b/sys/arch/sgi/gio/newport.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newport.c,v 1.9 2014/07/12 18:44:42 tedu Exp $ */ +/* $OpenBSD: newport.c,v 1.10 2015/09/08 10:21:50 deraadt Exp $ */ /* $NetBSD: newport.c,v 1.15 2009/05/12 23:51:25 macallan Exp $ */ /* @@ -554,7 +554,7 @@ newport_attach(struct device *parent, struct device *self, void *aux) if (fail) { printf("%s: failed to initialize screen\n", self->dv_xname); - free(dc, M_DEVBUF, 0); + free(dc, M_DEVBUF, sizeof *dc); return; } diff --git a/sys/arch/sgi/sgi/eisa_machdep.c b/sys/arch/sgi/sgi/eisa_machdep.c index 01ede04030d..0a99007e3a9 100644 --- a/sys/arch/sgi/sgi/eisa_machdep.c +++ b/sys/arch/sgi/sgi/eisa_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eisa_machdep.c,v 1.3 2014/07/12 18:44:42 tedu Exp $ */ +/* $OpenBSD: eisa_machdep.c,v 1.4 2015/09/08 10:21:50 deraadt Exp $ */ /* * Copyright (c) 2012 Miodrag Vallat. @@ -183,7 +183,7 @@ eisa_intr_disestablish(eisa_chipset_tag_t ec, void *cookie) } evcount_detach(&eih->ei_evcnt); - free(eih, M_DEVBUF, 0); + free(eih, M_DEVBUF, sizeof *eih); } int diff --git a/sys/arch/sgi/sgi/ip27_machdep.c b/sys/arch/sgi/sgi/ip27_machdep.c index 157d5ba5dd4..ef8d320faac 100644 --- a/sys/arch/sgi/sgi/ip27_machdep.c +++ b/sys/arch/sgi/sgi/ip27_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip27_machdep.c,v 1.65 2014/11/25 19:08:42 miod Exp $ */ +/* $OpenBSD: ip27_machdep.c,v 1.66 2015/09/08 10:21:50 deraadt Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -786,7 +786,7 @@ ip27_hub_intr_disestablish(int intrbit) splx(s); if (ISSET(ih->ih_flags, IH_ALLOCATED)) - free(ih, M_DEVBUF, 0); + free(ih, M_DEVBUF, sizeof *ih); } void diff --git a/sys/arch/sgi/sgi/l1.c b/sys/arch/sgi/sgi/l1.c index b566fe586c5..8c46a70109f 100644 --- a/sys/arch/sgi/sgi/l1.c +++ b/sys/arch/sgi/sgi/l1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: l1.c,v 1.9 2014/11/25 19:08:42 miod Exp $ */ +/* $OpenBSD: l1.c,v 1.10 2015/09/08 10:21:50 deraadt Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. @@ -771,7 +771,7 @@ l1_read_board_ia(int16_t nasid, int type, u_char **ria, size_t *rialen) fail: if (ia != NULL) - free(ia, M_DEVBUF, 0); + free(ia, M_DEVBUF, ialen); return rc; } @@ -914,7 +914,7 @@ l1_get_brick_ethernet_address(int16_t nasid, uint8_t *enaddr) enaddr_aton(hexaddr, enaddr); out: - free(ia, M_DEVBUF, 0); + free(ia, M_DEVBUF, ialen); return rc; } @@ -1188,7 +1188,7 @@ l1_get_brick_spd_record(int16_t nasid, int dimm, u_char **rspd, size_t *rspdlen) fail: if (spd != NULL) - free(spd, M_DEVBUF, 0); + free(spd, M_DEVBUF, spdlen); return rc; } diff --git a/sys/arch/sgi/xbow/xbridge.c b/sys/arch/sgi/xbow/xbridge.c index ddeec0660d9..bf9eca4b62b 100644 --- a/sys/arch/sgi/xbow/xbridge.c +++ b/sys/arch/sgi/xbow/xbridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbridge.c,v 1.96 2015/06/24 16:52:52 miod Exp $ */ +/* $OpenBSD: xbridge.c,v 1.97 2015/09/08 10:21:50 deraadt Exp $ */ /* * Copyright (c) 2008, 2009, 2011 Miodrag Vallat. @@ -1331,7 +1331,7 @@ xbridge_intr_establish(void *cookie, pci_intr_handle_t ih, int level, LIST_INIT(&xi->xi_handlers); if (xbow_intr_register(xb->xb_widget, level, &intrsrc) != 0) { - free(xi, M_DEVBUF, 0); + free(xi, M_DEVBUF, sizeof *xi); return NULL; } @@ -1439,7 +1439,7 @@ xbridge_intr_disestablish(void *cookie, void *vih) */ } - free(xih, M_DEVBUF, 0); + free(xih, M_DEVBUF, sizeof *xih); } int diff --git a/sys/arch/sgi/xbow/xheart.c b/sys/arch/sgi/xbow/xheart.c index 19d56516461..b8aa0bf2378 100644 --- a/sys/arch/sgi/xbow/xheart.c +++ b/sys/arch/sgi/xbow/xheart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xheart.c,v 1.27 2014/09/30 06:51:58 jmatthew Exp $ */ +/* $OpenBSD: xheart.c,v 1.28 2015/09/08 10:21:50 deraadt Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -374,7 +374,7 @@ xheart_intr_disestablish(int intrbit) splx(s); if (ISSET(ih->ih_flags, IH_ALLOCATED)) - free(ih, M_DEVBUF, 0); + free(ih, M_DEVBUF, sizeof *ih); } void |