From 0cc376c134826d6afe400a7fafade1c0e3f34551 Mon Sep 17 00:00:00 2001 From: Oleksandr Tymoshenko Date: Sat, 14 May 2016 20:06:38 +0000 Subject: [PATCH] Use OF_prop_free instead of direct call to free(9) Reviewed by: jhibbits --- sys/dev/iicbus/adt746x.c | 8 ++++---- sys/powerpc/mpc85xx/lbc.c | 6 +++--- sys/powerpc/psim/iobus.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/iicbus/adt746x.c b/sys/dev/iicbus/adt746x.c index 35cbc3eb47c5..179cd12ea47d 100644 --- a/sys/dev/iicbus/adt746x.c +++ b/sys/dev/iicbus/adt746x.c @@ -361,8 +361,8 @@ adt746x_fill_fan_prop(device_t dev) location_len = OF_getprop_alloc(child, "hwctrl-location", 1, (void **)&location); id_len = OF_getprop_alloc(child, "hwctrl-id", sizeof(cell_t), (void **)&id); if (location_len == -1 || id_len == -1) { - free(location, M_OFWPROP); - free(id, M_OFWPROP); + OF_prop_free(location); + OF_prop_free(id); return 0; } @@ -390,8 +390,8 @@ adt746x_fill_fan_prop(device_t dev) (int (*)(struct pmac_fan *, int))(adt746x_fan_set_pwm); sc->sc_fans[i].fan.default_rpm = sc->sc_fans[i].fan.max_rpm; } - free(location, M_OFWPROP); - free(id, M_OFWPROP); + OF_prop_free(location); + OF_prop_free(id); return (i); } diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c index 37e3ed054113..2c5702b0397b 100644 --- a/sys/powerpc/mpc85xx/lbc.c +++ b/sys/powerpc/mpc85xx/lbc.c @@ -408,7 +408,7 @@ fdt_lbc_reg_decode(phandle_t node, struct lbc_softc *sc, } rv = 0; out: - free(regptr, M_OFWPROP); + OF_prop_free(regptr); return (rv); } @@ -650,11 +650,11 @@ lbc_attach(device_t dev) */ lbc_banks_enable(sc); - free(rangesptr, M_OFWPROP); + OF_prop_free(rangesptr); return (bus_generic_attach(dev)); fail: - free(rangesptr, M_OFWPROP); + OF_prop_free(rangesptr); bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mrid, sc->sc_mres); return (error); } diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c index 37a23d18e772..8b57d47a388a 100644 --- a/sys/powerpc/psim/iobus.c +++ b/sys/powerpc/psim/iobus.c @@ -232,7 +232,7 @@ iobus_attach(device_t dev) iobus_add_reg(child, dinfo, sc->sc_addr); device_set_ivars(cdev, dinfo); } else { - free(name, M_OFWPROP); + OF_prop_free(name); } }