1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Use OF_prop_free instead of direct call to free(9)

Reviewed by:	jhibbits
This commit is contained in:
Oleksandr Tymoshenko 2016-05-14 20:06:38 +00:00
parent 68dd3f144c
commit 0cc376c134
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299756
3 changed files with 8 additions and 8 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}
}