From 6a095d5cb1bc22d35425aac5a4666242140bdb87 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sat, 12 Jul 2014 19:01:51 +0000 Subject: revert bogus free changes in not kernel files. got a little trigger happy. --- sys/arch/alpha/stand/installboot.c | 4 ++-- .../alpha/stand/setnetbootinfo/setnetbootinfo.c | 6 ++--- sys/arch/aviion/stand/a2coff/a2coff.c | 4 ++-- sys/arch/aviion/stand/boot/oaic.c | 4 ++-- sys/arch/aviion/stand/boot/oosiop.c | 6 ++--- sys/arch/aviion/stand/boot/scsi.c | 4 ++-- sys/arch/aviion/stand/boot/sd.c | 4 ++-- sys/arch/aviion/stand/vdmtool/vdmtool.c | 8 +++---- sys/arch/sgi/stand/sgivol/sgivol.c | 4 ++-- sys/arch/sparc/stand/installboot/installboot.c | 10 ++++----- sys/arch/sparc/stand/installboot/nlist.c | 4 ++-- sys/dev/microcode/aic7xxx/aicasm_symbol.c | 26 +++++++++++----------- sys/dev/microcode/bnx/build.c | 6 ++--- sys/dev/microcode/bwi/build/build.c | 8 +++---- sys/dev/microcode/bwi/extract/extract.c | 8 +++---- sys/dev/microcode/kue/build.c | 4 ++-- sys/dev/microcode/myx/build.c | 4 ++-- sys/dev/microcode/tigon/build.c | 4 ++-- sys/dev/microcode/yds/build.c | 4 ++-- 19 files changed, 61 insertions(+), 61 deletions(-) diff --git a/sys/arch/alpha/stand/installboot.c b/sys/arch/alpha/stand/installboot.c index 9becc1ce7a8..96f6f2978d4 100644 --- a/sys/arch/alpha/stand/installboot.c +++ b/sys/arch/alpha/stand/installboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: installboot.c,v 1.18 2014/07/12 18:44:40 tedu Exp $ */ +/* $OpenBSD: installboot.c,v 1.19 2014/07/12 19:01:49 tedu Exp $ */ /* $NetBSD: installboot.c,v 1.2 1997/04/06 08:41:12 cgd Exp $ */ /* @@ -258,7 +258,7 @@ loadprotoblocks(char *fname, long *size) } if (read(fd, bp, statbuf.st_size) != statbuf.st_size) { warn("read: %s", fname); - free(bp, 0); + free(bp); close(fd); return NULL; } diff --git a/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c b/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c index 30e71e88c5a..428be1693d3 100644 --- a/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c +++ b/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setnetbootinfo.c,v 1.3 2014/07/12 18:44:41 tedu Exp $ */ +/* $OpenBSD: setnetbootinfo.c,v 1.4 2014/07/12 19:01:49 tedu Exp $ */ /* $NetBSD: setnetbootinfo.c,v 1.5 1997/04/06 08:41:37 cgd Exp $ */ /* @@ -244,9 +244,9 @@ main(argc, argv) printf("closing %s...\n", outfilename); close(fd); - free(netbb, 0); + free(netbb); if (outfile == NULL) - free(outfilename, 0); + free(outfilename); exit (0); } diff --git a/sys/arch/aviion/stand/a2coff/a2coff.c b/sys/arch/aviion/stand/a2coff/a2coff.c index 6a2a3095d05..aa7edeed061 100644 --- a/sys/arch/aviion/stand/a2coff/a2coff.c +++ b/sys/arch/aviion/stand/a2coff/a2coff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a2coff.c,v 1.12 2014/07/12 18:44:41 tedu Exp $ */ +/* $OpenBSD: a2coff.c,v 1.13 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 2006, 2013, Miodrag Vallat * @@ -324,7 +324,7 @@ convert_elf(const char *infile, int infd, int outfd, Elf_Ehdr *ehdr) last = n; } - free(phdr, 0); + free(phdr); /* * Fill ``data'' section. diff --git a/sys/arch/aviion/stand/boot/oaic.c b/sys/arch/aviion/stand/boot/oaic.c index e166c12e1df..e52ceee204d 100644 --- a/sys/arch/aviion/stand/boot/oaic.c +++ b/sys/arch/aviion/stand/boot/oaic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: oaic.c,v 1.2 2014/07/12 18:44:41 tedu Exp $ */ +/* $OpenBSD: oaic.c,v 1.3 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 2010, 2013 Miodrag Vallat. @@ -225,7 +225,7 @@ oaic_attach(uint32_t addr, int id, int lun) void oaic_detach(void *cookie) { - free(cookie, sizeof(struct aic6250_softc), 0); + free(cookie, sizeof(struct aic6250_softc)); } /* diff --git a/sys/arch/aviion/stand/boot/oosiop.c b/sys/arch/aviion/stand/boot/oosiop.c index 0757704e068..34dc9ab90cc 100644 --- a/sys/arch/aviion/stand/boot/oosiop.c +++ b/sys/arch/aviion/stand/boot/oosiop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: oosiop.c,v 1.5 2014/07/12 18:44:41 tedu Exp $ */ +/* $OpenBSD: oosiop.c,v 1.6 2014/07/12 19:01:49 tedu Exp $ */ /* OpenBSD: oosiop.c,v 1.20 2013/10/09 18:22:06 miod Exp */ /* OpenBSD: oosiopvar.h,v 1.5 2011/04/03 12:42:36 krw Exp */ /* $NetBSD: oosiop.c,v 1.4 2003/10/29 17:45:55 tsutsui Exp $ */ @@ -214,8 +214,8 @@ oosiop_detach(void *cookie) { struct oosiop_softc *sc = cookie; - free(sc->sc_scr, sizeof(oosiop_script), 0); - free(sc, sizeof *sc, 0); + free(sc->sc_scr, sizeof(oosiop_script)); + free(sc, sizeof *sc); } static __inline void diff --git a/sys/arch/aviion/stand/boot/scsi.c b/sys/arch/aviion/stand/boot/scsi.c index bd00afef27e..5bce368030c 100644 --- a/sys/arch/aviion/stand/boot/scsi.c +++ b/sys/arch/aviion/stand/boot/scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi.c,v 1.3 2014/07/12 18:44:41 tedu Exp $ */ +/* $OpenBSD: scsi.c,v 1.4 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -93,7 +93,7 @@ scsi_initialize(const char *ctrlname, int ctrl, int unit, int lun, int part) done: if (priv->scsicookie == NULL) { - free(priv, sizeof(struct scsi_private), 0); + free(priv, sizeof(struct scsi_private)); priv = NULL; } diff --git a/sys/arch/aviion/stand/boot/sd.c b/sys/arch/aviion/stand/boot/sd.c index 2e01fae35d2..76246753eee 100644 --- a/sys/arch/aviion/stand/boot/sd.c +++ b/sys/arch/aviion/stand/boot/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.6 2014/07/12 18:44:41 tedu Exp $ */ +/* $OpenBSD: sd.c,v 1.7 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -92,7 +92,7 @@ sdclose(struct open_file *f) priv = (struct scsi_private *)f->f_devdata; if (priv->scsicookie != NULL) (*priv->scsidetach)(priv->scsicookie); - free(priv, sizeof(struct scsi_private), 0); + free(priv, sizeof(struct scsi_private)); f->f_devdata = NULL; } diff --git a/sys/arch/aviion/stand/vdmtool/vdmtool.c b/sys/arch/aviion/stand/vdmtool/vdmtool.c index 9a22b6136f8..d4edac3224a 100644 --- a/sys/arch/aviion/stand/vdmtool/vdmtool.c +++ b/sys/arch/aviion/stand/vdmtool/vdmtool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdmtool.c,v 1.3 2014/07/12 18:44:41 tedu Exp $ */ +/* $OpenBSD: vdmtool.c,v 1.4 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -534,7 +534,7 @@ read_vdit(int fd, uint32_t secno, size_t *vditsize) curbuf = append_vdit_portion(fd, secno, curbuf, sector, first ? VDIT_BLOCK_HEAD_BE : VDIT_PORTION_HEADER_BLOCK); if (curbuf == NULL) { - free(buf, 0); + free(buf); return NULL; } first = 0; @@ -606,10 +606,10 @@ report(int fd) } if (memcmp(vdit, vdit2, vditsize) != 0) printf("VDIT and backup VDIT differ!\n"); - free(vdit2, 0); + free(vdit2); } - free(vdit, 0); + free(vdit); } } diff --git a/sys/arch/sgi/stand/sgivol/sgivol.c b/sys/arch/sgi/stand/sgivol/sgivol.c index fa054a3c324..b4b2993cc07 100644 --- a/sys/arch/sgi/stand/sgivol/sgivol.c +++ b/sys/arch/sgi/stand/sgivol/sgivol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sgivol.c,v 1.22 2014/07/12 18:44:42 tedu Exp $ */ +/* $OpenBSD: sgivol.c,v 1.23 2014/07/12 19:01:49 tedu Exp $ */ /* $NetBSD: sgivol.c,v 1.8 2003/11/08 04:59:00 sekiya Exp $ */ /*- @@ -432,7 +432,7 @@ write_file(void) i -= fsize; } fclose(fp); - free(fbuf, 0); + free(fbuf); } void diff --git a/sys/arch/sparc/stand/installboot/installboot.c b/sys/arch/sparc/stand/installboot/installboot.c index 0409685f3cd..8e0a47aeb09 100644 --- a/sys/arch/sparc/stand/installboot/installboot.c +++ b/sys/arch/sparc/stand/installboot/installboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: installboot.c,v 1.9 2014/07/12 18:44:43 tedu Exp $ */ +/* $OpenBSD: installboot.c,v 1.10 2014/07/12 19:01:49 tedu Exp $ */ /* $NetBSD: installboot.c,v 1.1 1997/06/01 03:39:45 mrg Exp $ */ /* @@ -251,7 +251,7 @@ loadprotoblocks(fname, size) } if (read(fd, bp, statbuf.st_size) != statbuf.st_size) { warn("read: %s", fname); - free(bp, 0); + free(bp); close(fd); return NULL; } @@ -269,21 +269,21 @@ loadprotoblocks(fname, size) if ((int)block_table & 3) { warn("%s: invalid address: block_table = %x", fname, block_table); - free(bp, 0); + free(bp); close(fd); return NULL; } if ((int)block_count_p & 3) { warn("%s: invalid address: block_count_p = %x", fname, block_count_p); - free(bp, 0); + free(bp); close(fd); return NULL; } if ((int)block_size_p & 3) { warn("%s: invalid address: block_size_p = %x", fname, block_size_p); - free(bp, 0); + free(bp); close(fd); return NULL; } diff --git a/sys/arch/sparc/stand/installboot/nlist.c b/sys/arch/sparc/stand/installboot/nlist.c index 0b4b2d7ca47..fe016db3f22 100644 --- a/sys/arch/sparc/stand/installboot/nlist.c +++ b/sys/arch/sparc/stand/installboot/nlist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nlist.c,v 1.2 2014/07/12 18:44:43 tedu Exp $ */ +/* $OpenBSD: nlist.c,v 1.3 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -137,7 +137,7 @@ __aout_fdnlist(int fd, struct nlist *list) } aout_done: if (usemalloc) - free(strtab, 0); + free(strtab); else munmap(strtab, strsize); return (nent); diff --git a/sys/dev/microcode/aic7xxx/aicasm_symbol.c b/sys/dev/microcode/aic7xxx/aicasm_symbol.c index 3474ec074c0..4c6b834cf7a 100644 --- a/sys/dev/microcode/aic7xxx/aicasm_symbol.c +++ b/sys/dev/microcode/aic7xxx/aicasm_symbol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aicasm_symbol.c,v 1.12 2014/07/12 18:48:18 tedu Exp $ */ +/* $OpenBSD: aicasm_symbol.c,v 1.13 2014/07/12 19:01:49 tedu Exp $ */ /* $NetBSD: aicasm_symbol.c,v 1.4 2003/07/14 15:42:40 lukem Exp $ */ /* @@ -96,11 +96,11 @@ symbol_delete(symbol_t *symbol) case SRAMLOC: case REGISTER: if (symbol->info.rinfo != NULL) - free(symbol->info.rinfo, 0); + free(symbol->info.rinfo); break; case ALIAS: if (symbol->info.ainfo != NULL) - free(symbol->info.ainfo, 0); + free(symbol->info.ainfo); break; case MASK: case FIELD: @@ -108,24 +108,24 @@ symbol_delete(symbol_t *symbol) case ENUM_ENTRY: if (symbol->info.finfo != NULL) { symlist_free(&symbol->info.finfo->symrefs); - free(symbol->info.finfo, 0); + free(symbol->info.finfo); } break; case DOWNLOAD_CONST: case CONST: if (symbol->info.cinfo != NULL) - free(symbol->info.cinfo, 0); + free(symbol->info.cinfo); break; case LABEL: if (symbol->info.linfo != NULL) - free(symbol->info.linfo, 0); + free(symbol->info.linfo); break; case UNINITIALIZED: default: break; } - free(symbol->name, 0); - free(symbol, 0); + free(symbol->name); + free(symbol); } void @@ -299,7 +299,7 @@ symlist_free(symlist_t *symlist) node1 = SLIST_FIRST(symlist); while (node1 != NULL) { node2 = SLIST_NEXT(node1, links); - free(node1, 0); + free(node1); node1 = node2; } SLIST_INIT(symlist); @@ -632,7 +632,7 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "#define%s%-16s%s0x%02x\n", tab_str, curnode->symbol->name, tab_str2, value); - free(curnode, 0); + free(curnode); } fprintf(ofile, "\n\n"); @@ -644,7 +644,7 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "#define\t%-8s\t0x%02x\n", curnode->symbol->name, curnode->symbol->info.cinfo->value); - free(curnode, 0); + free(curnode); } @@ -658,7 +658,7 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "#define\t%-8s\t0x%02x\n", curnode->symbol->name, curnode->symbol->info.cinfo->value); - free(curnode, 0); + free(curnode); } fprintf(ofile, "#define\tDOWNLOAD_CONST_COUNT\t0x%02x\n", i); @@ -672,7 +672,7 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "#define\tLABEL_%-8s\t0x%02x\n", curnode->symbol->name, curnode->symbol->info.linfo->address); - free(curnode, 0); + free(curnode); } } diff --git a/sys/dev/microcode/bnx/build.c b/sys/dev/microcode/bnx/build.c index 47e62305bc7..2b8a66f936f 100644 --- a/sys/dev/microcode/bnx/build.c +++ b/sys/dev/microcode/bnx/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.6 2014/07/12 18:48:18 tedu Exp $ */ +/* $OpenBSD: build.c,v 1.7 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 2004 Theo de Raadt @@ -297,7 +297,7 @@ main(int argc, char *argv[]) write_firmware(FILENAME_B09, bf, sizeof(*bf), chunks_b09, nitems(chunks_b09)); - free(bf, 0); + free(bf); rh = (struct bnx_rv2p_header *)malloc(sizeof *rh); @@ -328,7 +328,7 @@ main(int argc, char *argv[]) write_firmware(FILENAME_XI90_RV2P, rh, sizeof(*rh), chunks_xi90_rv2p, nitems(chunks_xi90_rv2p)); - free(rh, 0); + free(rh); return 0; } diff --git a/sys/dev/microcode/bwi/build/build.c b/sys/dev/microcode/bwi/build/build.c index e286e82f3a3..2869b3ad0cc 100644 --- a/sys/dev/microcode/bwi/build/build.c +++ b/sys/dev/microcode/bwi/build/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.2 2014/07/12 18:48:18 tedu Exp $ */ +/* $OpenBSD: build.c,v 1.3 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 2006 Marcus Glocker @@ -131,18 +131,18 @@ main(int argc, char *argv[]) err(1, "malloc"); } if (read(fdin, p, h[i].filesize) < 1) { - free(p, 0); + free(p); close(fdout); close(fdin); err(1, "read input file failed\n"); } if (write(fdout, p, h[i].filesize) < 1) { - free(p, 0); + free(p); close(fdout); close(fdin); err(1, "write to output file failed\n"); } - free(p, 0); + free(p); close(fdin); } diff --git a/sys/dev/microcode/bwi/extract/extract.c b/sys/dev/microcode/bwi/extract/extract.c index 0c91ab8ebee..a0304b7e500 100644 --- a/sys/dev/microcode/bwi/extract/extract.c +++ b/sys/dev/microcode/bwi/extract/extract.c @@ -1,4 +1,4 @@ -/* $OpenBSD: extract.c,v 1.2 2014/07/12 18:48:18 tedu Exp $ */ +/* $OpenBSD: extract.c,v 1.3 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 2006 Marcus Glocker @@ -85,7 +85,7 @@ main(int argc, char *argv[]) err(1, "read from input file failed"); if (write(fdout, p, h[i]->filesize) < 1) err(1, "write to output file failed"); - free(p, 0); + free(p); close(fdout); printf("extracting %s (filesize %d, fileoffset %d)\n", h[i]->filename, h[i]->filesize, h[i]->fileoffset); @@ -93,8 +93,8 @@ main(int argc, char *argv[]) /* free header space */ for (i = 0; i < nfiles; i++) - free(h[i], 0); - free(h, 0); + free(h[i]); + free(h); /* game over */ close (fdin); diff --git a/sys/dev/microcode/kue/build.c b/sys/dev/microcode/kue/build.c index 55f06583419..9e8e2e7db5a 100644 --- a/sys/dev/microcode/kue/build.c +++ b/sys/dev/microcode/kue/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.5 2014/07/12 18:48:18 tedu Exp $ */ +/* $OpenBSD: build.c,v 1.6 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 2004 Theo de Raadt @@ -65,7 +65,7 @@ main(int argc, char *argv[]) err(1, "%s", FILENAME); if (rlen != len) errx(1, "%s: short write", FILENAME); - free(kf, 0); + free(kf); close(fd); return 0; } diff --git a/sys/dev/microcode/myx/build.c b/sys/dev/microcode/myx/build.c index a66764250fb..5c530992524 100644 --- a/sys/dev/microcode/myx/build.c +++ b/sys/dev/microcode/myx/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.3 2014/07/12 18:48:18 tedu Exp $ */ +/* $OpenBSD: build.c,v 1.4 2014/07/12 19:01:49 tedu Exp $ */ /* * Copyright (c) 2007 Reyk Floeter @@ -82,7 +82,7 @@ myx_build_firmware(u_int8_t *fw, size_t len, size_t ulen, const char *file) } while (total < ulen); printf("%s: len %zu -> %zu\n", file, len, ulen); - free(ufw, 0); + free(ufw); fclose(f); } diff --git a/sys/dev/microcode/tigon/build.c b/sys/dev/microcode/tigon/build.c index 048de9c3674..ef42170f7ac 100644 --- a/sys/dev/microcode/tigon/build.c +++ b/sys/dev/microcode/tigon/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.7 2014/07/12 18:48:18 tedu Exp $ */ +/* $OpenBSD: build.c,v 1.8 2014/07/12 19:01:50 tedu Exp $ */ /* * Copyright (c) 2004 Theo de Raadt @@ -95,7 +95,7 @@ output(const char *name, err(1, "%s", name); if (rlen != len) errx(1, "%s: short write", name); - free(tf, 0); + free(tf); close(fd); } diff --git a/sys/dev/microcode/yds/build.c b/sys/dev/microcode/yds/build.c index 392a250803e..e1ac354ce70 100644 --- a/sys/dev/microcode/yds/build.c +++ b/sys/dev/microcode/yds/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.5 2014/07/12 18:48:18 tedu Exp $ */ +/* $OpenBSD: build.c,v 1.6 2014/07/12 19:01:50 tedu Exp $ */ /* * Copyright (c) 2004 Theo de Raadt @@ -81,7 +81,7 @@ main(int argc, char *argv[]) err(1, "%s", FILENAME); if (rlen != len) errx(1, "%s: short write", FILENAME); - free(yf, 0); + free(yf); close(fd); return 0; } -- cgit v1.2.3