diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-09-01 06:01:27 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-09-01 06:01:27 +0000 |
commit | 2c2cc5586d746c118989e15a08a3946beea54928 (patch) | |
tree | f9151d405576ba4f1372a5cc68d59a4f39a1e44b /sys/arch | |
parent | d45ce98a31858bc612c17d4cfd8f7da1a4460a6b (diff) |
fairly simple sizes for free()
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/i386/softintr.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/isa_machdep.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/pci/pci_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/pci/piix.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/pci/rccosb4.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/pci/vga_post.c | 6 |
6 files changed, 16 insertions, 16 deletions
diff --git a/sys/arch/i386/i386/softintr.c b/sys/arch/i386/i386/softintr.c index fe236a86447..efa5e8b9e34 100644 --- a/sys/arch/i386/i386/softintr.c +++ b/sys/arch/i386/i386/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.6 2015/07/16 05:10:14 guenther Exp $ */ +/* $OpenBSD: softintr.c,v 1.7 2015/09/01 06:01:26 deraadt Exp $ */ /* $NetBSD: softintr.c,v 1.1 2003/02/26 21:26:12 fvdl Exp $ */ /*- @@ -159,5 +159,5 @@ softintr_disestablish(void *arg) } mtx_leave(&si->softintr_lock); - free(sih, M_DEVBUF, 0); + free(sih, M_DEVBUF, sizeof(*sih)); } diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c index f511b756cf5..b52b56e9fe7 100644 --- a/sys/arch/i386/isa/isa_machdep.c +++ b/sys/arch/i386/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isa_machdep.c,v 1.80 2015/07/13 17:45:01 mikeb Exp $ */ +/* $OpenBSD: isa_machdep.c,v 1.81 2015/09/01 06:01:26 deraadt Exp $ */ /* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */ /*- @@ -504,7 +504,7 @@ isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, if (!LEGAL_IRQ(irq) || type == IST_NONE) { printf("%s: isa_intr_establish: bogus irq or type\n", ih_what); - free(ih, M_DEVBUF, 0); + free(ih, M_DEVBUF, sizeof *ih); return (NULL); } switch (intrtype[irq]) { @@ -522,7 +522,7 @@ isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, /*printf("%s: intr_establish: can't share %s with %s, irq %d\n", ih_what, isa_intr_typename(intrtype[irq]), isa_intr_typename(type), irq);*/ - free(ih, M_DEVBUF, 0); + free(ih, M_DEVBUF, sizeof *ih); return (NULL); } break; @@ -592,7 +592,7 @@ isa_intr_disestablish(isa_chipset_tag_t ic, void *arg) else panic("intr_disestablish: handler not registered"); evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF, 0); + free(ih, M_DEVBUF, sizeof *ih); intr_calculatemasks(); diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c index 27cbc973889..cf08b23ab55 100644 --- a/sys/arch/i386/pci/pci_machdep.c +++ b/sys/arch/i386/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.80 2015/01/24 15:13:55 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.81 2015/09/01 06:01:24 deraadt Exp $ */ /* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */ /*- @@ -868,7 +868,7 @@ pci_intr_disestablish(pci_chipset_tag_t pc, void *cookie) idt_vec_free(ih->ih_vec); evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF, 0); + free(ih, M_DEVBUF, sizeof *ih); return; } diff --git a/sys/arch/i386/pci/piix.c b/sys/arch/i386/pci/piix.c index 206e3891b96..9b0705b4249 100644 --- a/sys/arch/i386/pci/piix.c +++ b/sys/arch/i386/pci/piix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: piix.c,v 1.10 2014/07/12 18:44:42 tedu Exp $ */ +/* $OpenBSD: piix.c,v 1.11 2015/09/01 06:01:24 deraadt Exp $ */ /* $NetBSD: piix.c,v 1.1 1999/11/17 01:21:20 thorpej Exp $ */ /*- @@ -113,7 +113,7 @@ piix_init(pci_chipset_tag_t pc, bus_space_tag_t iot, pcitag_t tag, if (bus_space_map(iot, PIIX_REG_ELCR, PIIX_REG_ELCR_SIZE, 0, &ph->ph_elcr_ioh) != 0) { - free(ph, M_DEVBUF, 0); + free(ph, M_DEVBUF, sizeof *ph); return (1); } diff --git a/sys/arch/i386/pci/rccosb4.c b/sys/arch/i386/pci/rccosb4.c index dc1f0446372..4768c7a979c 100644 --- a/sys/arch/i386/pci/rccosb4.c +++ b/sys/arch/i386/pci/rccosb4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rccosb4.c,v 1.5 2014/07/12 18:44:42 tedu Exp $ */ +/* $OpenBSD: rccosb4.c,v 1.6 2015/09/01 06:01:24 deraadt Exp $ */ /* * Copyright (c) 2004,2005 Michael Shalayeff @@ -79,12 +79,12 @@ osb4_init(pci_chipset_tag_t pc, bus_space_tag_t iot, pcitag_t tag, ph->piix.ph_tag = tag; if (bus_space_map(iot, OSB4_PIAIR, 2, 0, &ph->osb4_ioh)) { - free(ph, M_DEVBUF, 0); + free(ph, M_DEVBUF, sizeof *ph); return (1); } if (bus_space_map(iot, OSB4_REG_ELCR, 2, 0, &ph->piix.ph_elcr_ioh)) { - free(ph, M_DEVBUF, 0); + free(ph, M_DEVBUF, sizeof *ph); return (1); } diff --git a/sys/arch/i386/pci/vga_post.c b/sys/arch/i386/pci/vga_post.c index 66e92fe9db6..c85ee05dcdb 100644 --- a/sys/arch/i386/pci/vga_post.c +++ b/sys/arch/i386/pci/vga_post.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_post.c,v 1.8 2014/11/16 12:30:57 deraadt Exp $ */ +/* $OpenBSD: vga_post.c,v 1.9 2015/09/01 06:01:24 deraadt Exp $ */ /* $NetBSD: vga_post.c,v 1.12 2009/03/15 21:32:36 cegger Exp $ */ /*- @@ -142,7 +142,7 @@ vga_post_init(int bus, int device, int function) &sc->ram_backing, BASE_MEMORY/PAGE_SIZE, UVM_PLA_WAITOK); if (err) { uvm_km_free(kernel_map, sc->sys_image, 1024 * 1024); - free(sc, M_DEVBUF, 0); + free(sc, M_DEVBUF, sizeof *sc); return NULL; } @@ -213,7 +213,7 @@ vga_post_free(struct vga_post *sc) uvm_km_free(kernel_map, sc->sys_image, 1024 * 1024); pmap_update(pmap_kernel()); - free(sc, M_DEVBUF, 0); + free(sc, M_DEVBUF, sizeof *sc); } #ifdef DDB |