From 5dc5a81e986b601d8ab1c1db5a736a0865bc250e Mon Sep 17 00:00:00 2001 From: tedu Date: Sat, 12 Jul 2014 18:50:25 +0000 Subject: [PATCH] add a size argument to free. will be used soon, but for now default to 0. after discussions with beck deraadt kettenis. --- sys/scsi/cd.c | 4 ++-- sys/scsi/ch.c | 4 ++-- sys/scsi/mpath.c | 6 +++--- sys/scsi/safte.c | 6 +++--- sys/scsi/scsiconf.c | 14 +++++++------- sys/scsi/sd.c | 4 ++-- sys/scsi/ses.c | 14 +++++++------- sys/tmpfs/tmpfs_mem.c | 4 ++-- sys/tmpfs/tmpfs_vfsops.c | 4 ++-- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index cecb73d9c11..0967cdf0623 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.213 2013/11/01 17:36:19 krw Exp $ */ +/* $OpenBSD: cd.c,v 1.214 2014/07/12 18:50:25 tedu Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -792,7 +792,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); cdgetdisklabel(dev, sc, lp, 0); bcopy(lp, sc->sc_dk.dk_label, sizeof(*lp)); - free(lp, M_TEMP); + free(lp, M_TEMP, 0); break; case DIOCGPDINFO: diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c index 4a27837cf17..d00f1d0515c 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ch.c,v 1.46 2011/06/17 00:00:51 matthew Exp $ */ +/* $OpenBSD: ch.c,v 1.47 2014/07/12 18:50:25 tedu Exp $ */ /* $NetBSD: ch.c,v 1.26 1997/02/21 22:06:52 thorpej Exp $ */ /* @@ -615,7 +615,7 @@ ch_usergetelemstatus(struct ch_softc *sc, if (data != NULL) dma_free(data, size); if (user_data != NULL) - free(user_data, M_DEVBUF); + free(user_data, M_DEVBUF, 0); return (error); } diff --git a/sys/scsi/mpath.c b/sys/scsi/mpath.c index 777397d7e6d..9edc4b45279 100644 --- a/sys/scsi/mpath.c +++ b/sys/scsi/mpath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpath.c,v 1.35 2014/05/01 10:25:44 jsg Exp $ */ +/* $OpenBSD: mpath.c,v 1.36 2014/07/12 18:50:25 tedu Exp $ */ /* * Copyright (c) 2009 David Gwynne @@ -503,7 +503,7 @@ mpath_path_attach(struct mpath_path *p, u_int g_id, const struct mpath_ops *ops) M_WAITOK | M_CANFAIL | M_ZERO); if (g == NULL) { if (newdev) { - free(d, M_DEVBUF); + free(d, M_DEVBUF, 0); sc->sc_devs[target] = NULL; } @@ -567,7 +567,7 @@ mpath_path_detach(struct mpath_path *p) mtx_leave(&d->d_mtx); if (g != NULL) - free(g, M_DEVBUF); + free(g, M_DEVBUF, 0); scsi_xsh_del(&p->p_xsh); diff --git a/sys/scsi/safte.c b/sys/scsi/safte.c index 4cc0586c8bc..5ac48e7fc61 100644 --- a/sys/scsi/safte.c +++ b/sys/scsi/safte.c @@ -1,4 +1,4 @@ -/* $OpenBSD: safte.c,v 1.48 2011/06/15 01:10:05 dlg Exp $ */ +/* $OpenBSD: safte.c,v 1.49 2014/07/12 18:50:25 tedu Exp $ */ /* * Copyright (c) 2005 David Gwynne @@ -201,7 +201,7 @@ safte_attach(struct device *parent, struct device *self, void *aux) printf("%s: unable to register update task\n", DEVNAME(sc)); sc->sc_nsensors = sc->sc_ntemps = 0; - free(sc->sc_sensors, M_DEVBUF); + free(sc->sc_sensors, M_DEVBUF, 0); } else { for (i = 0; i < sc->sc_nsensors; i++) sensor_attach(&sc->sc_sensordev, @@ -247,7 +247,7 @@ safte_detach(struct device *self, int flags) for (i = 0; i < sc->sc_nsensors; i++) sensor_detach(&sc->sc_sensordev, &sc->sc_sensors[i].se_sensor); - free(sc->sc_sensors, M_DEVBUF); + free(sc->sc_sensors, M_DEVBUF, 0); } if (sc->sc_encbuf != NULL) diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 43dcd48922d..0702b3d0674 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.c,v 1.187 2014/04/22 07:29:11 dlg Exp $ */ +/* $OpenBSD: scsiconf.c,v 1.188 2014/07/12 18:50:25 tedu Exp $ */ /* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */ /* @@ -506,7 +506,7 @@ scsi_detach_lun(struct scsibus_softc *sc, int target, int lun, int flags) /* 3. if its using the openings io allocator, clean it up */ if (ISSET(link->flags, SDEV_OWN_IOPL)) { scsi_iopool_destroy(link->pool); - free(link->pool, M_DEVBUF); + free(link->pool, M_DEVBUF, 0); } /* 4. free up its state in the adapter */ @@ -517,7 +517,7 @@ scsi_detach_lun(struct scsibus_softc *sc, int target, int lun, int flags) if (link->id != NULL) devid_free(link->id); scsi_remove_link(sc, link); - free(link, M_DEVBUF); + free(link, M_DEVBUF, 0); return (0); } @@ -1068,12 +1068,12 @@ free_devid: devid_free(sc_link->id); bad: if (ISSET(sc_link->flags, SDEV_OWN_IOPL)) - free(sc_link->pool, M_DEVBUF); + free(sc_link->pool, M_DEVBUF, 0); if (scsi->adapter_link->adapter->dev_free != NULL) scsi->adapter_link->adapter->dev_free(sc_link); free: - free(sc_link, M_DEVBUF); + free(sc_link, M_DEVBUF, 0); return (rslt); } @@ -1310,7 +1310,7 @@ scsi_devid_pg80(struct scsi_link *link) sizeof(link->inqdata.vendor) + sizeof(link->inqdata.product) + len, id); - free(id, M_TEMP); + free(id, M_TEMP, 0); free: dma_free(pg, pglen); @@ -1372,5 +1372,5 @@ void devid_free(struct devid *d) { if (--d->d_refcount == 0) - free(d, M_DEVBUF); + free(d, M_DEVBUF, 0); } diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 15394b1b12f..2db143af94b 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.254 2014/07/10 19:13:55 mpi Exp $ */ +/* $OpenBSD: sd.c,v 1.255 2014/07/12 18:50:25 tedu Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -863,7 +863,7 @@ sdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); sdgetdisklabel(dev, sc, lp, 0); bcopy(lp, sc->sc_dk.dk_label, sizeof(*lp)); - free(lp, M_TEMP); + free(lp, M_TEMP, 0); goto exit; case DIOCGPDINFO: diff --git a/sys/scsi/ses.c b/sys/scsi/ses.c index c91e9a3113e..456aa656fd3 100644 --- a/sys/scsi/ses.c +++ b/sys/scsi/ses.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ses.c,v 1.51 2011/03/17 21:30:24 deraadt Exp $ */ +/* $OpenBSD: ses.c,v 1.52 2014/07/12 18:50:25 tedu Exp $ */ /* * Copyright (c) 2005 David Gwynne @@ -181,7 +181,7 @@ ses_attach(struct device *parent, struct device *self, void *aux) sensor = TAILQ_FIRST(&sc->sc_sensors); TAILQ_REMOVE(&sc->sc_sensors, sensor, se_entry); - free(sensor, M_DEVBUF); + free(sensor, M_DEVBUF, 0); } } else { TAILQ_FOREACH(sensor, &sc->sc_sensors, se_entry) @@ -198,7 +198,7 @@ ses_attach(struct device *parent, struct device *self, void *aux) while (!TAILQ_EMPTY(&sc->sc_slots)) { slot = TAILQ_FIRST(&sc->sc_slots); TAILQ_REMOVE(&sc->sc_slots, slot, sl_entry); - free(slot, M_DEVBUF); + free(slot, M_DEVBUF, 0); } } #endif @@ -230,7 +230,7 @@ ses_detach(struct device *self, int flags) while (!TAILQ_EMPTY(&sc->sc_slots)) { slot = TAILQ_FIRST(&sc->sc_slots); TAILQ_REMOVE(&sc->sc_slots, slot, sl_entry); - free(slot, M_DEVBUF); + free(slot, M_DEVBUF, 0); } } #endif @@ -243,7 +243,7 @@ ses_detach(struct device *self, int flags) sensor = TAILQ_FIRST(&sc->sc_sensors); sensor_detach(&sc->sc_sensordev, &sensor->se_sensor); TAILQ_REMOVE(&sc->sc_sensors, sensor, se_entry); - free(sensor, M_DEVBUF); + free(sensor, M_DEVBUF, 0); } } @@ -500,13 +500,13 @@ error: while (!TAILQ_EMPTY(&sc->sc_slots)) { slot = TAILQ_FIRST(&sc->sc_slots); TAILQ_REMOVE(&sc->sc_slots, slot, sl_entry); - free(slot, M_DEVBUF); + free(slot, M_DEVBUF, 0); } #endif while (!TAILQ_EMPTY(&sc->sc_sensors)) { sensor = TAILQ_FIRST(&sc->sc_sensors); TAILQ_REMOVE(&sc->sc_sensors, sensor, se_entry); - free(sensor, M_DEVBUF); + free(sensor, M_DEVBUF, 0); } return (1); } diff --git a/sys/tmpfs/tmpfs_mem.c b/sys/tmpfs/tmpfs_mem.c index 65ff1ab9072..89a827d034d 100644 --- a/sys/tmpfs/tmpfs_mem.c +++ b/sys/tmpfs/tmpfs_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmpfs_mem.c,v 1.3 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: tmpfs_mem.c,v 1.4 2014/07/12 18:50:25 tedu Exp $ */ /* $NetBSD: tmpfs_mem.c,v 1.4 2011/05/24 01:09:47 rmind Exp $ */ /* @@ -218,7 +218,7 @@ tmpfs_strname_free(struct tmpfs_mount *mp, char *str, size_t len) KASSERT(sz > 0 && sz <= 1024); tmpfs_mem_decr(mp, sz); - free(str, M_TEMP); + free(str, M_TEMP, 0); } int diff --git a/sys/tmpfs/tmpfs_vfsops.c b/sys/tmpfs/tmpfs_vfsops.c index faf8e36192b..32ea53886df 100644 --- a/sys/tmpfs/tmpfs_vfsops.c +++ b/sys/tmpfs/tmpfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmpfs_vfsops.c,v 1.3 2013/12/14 18:01:52 espie Exp $ */ +/* $OpenBSD: tmpfs_vfsops.c,v 1.4 2014/07/12 18:50:25 tedu Exp $ */ /* $NetBSD: tmpfs_vfsops.c,v 1.52 2011/09/27 01:10:43 christos Exp $ */ /* @@ -255,7 +255,7 @@ tmpfs_unmount(struct mount *mp, int mntflags, struct proc *p) tmpfs_mntmem_destroy(tmp); /* mutex_destroy(&tmp->tm_lock); */ /* kmem_free(tmp, sizeof(*tmp)); */ - free(tmp, M_MISCFSMNT); + free(tmp, M_MISCFSMNT, 0); mp->mnt_data = NULL; return 0; -- 2.20.1