mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
Use OF_prop_free instead of direct call to free(9)
Reviewed by: jhibbits
This commit is contained in:
parent
68dd3f144c
commit
0cc376c134
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299756
@ -361,8 +361,8 @@ adt746x_fill_fan_prop(device_t dev)
|
|||||||
location_len = OF_getprop_alloc(child, "hwctrl-location", 1, (void **)&location);
|
location_len = OF_getprop_alloc(child, "hwctrl-location", 1, (void **)&location);
|
||||||
id_len = OF_getprop_alloc(child, "hwctrl-id", sizeof(cell_t), (void **)&id);
|
id_len = OF_getprop_alloc(child, "hwctrl-id", sizeof(cell_t), (void **)&id);
|
||||||
if (location_len == -1 || id_len == -1) {
|
if (location_len == -1 || id_len == -1) {
|
||||||
free(location, M_OFWPROP);
|
OF_prop_free(location);
|
||||||
free(id, M_OFWPROP);
|
OF_prop_free(id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,8 +390,8 @@ adt746x_fill_fan_prop(device_t dev)
|
|||||||
(int (*)(struct pmac_fan *, int))(adt746x_fan_set_pwm);
|
(int (*)(struct pmac_fan *, int))(adt746x_fan_set_pwm);
|
||||||
sc->sc_fans[i].fan.default_rpm = sc->sc_fans[i].fan.max_rpm;
|
sc->sc_fans[i].fan.default_rpm = sc->sc_fans[i].fan.max_rpm;
|
||||||
}
|
}
|
||||||
free(location, M_OFWPROP);
|
OF_prop_free(location);
|
||||||
free(id, M_OFWPROP);
|
OF_prop_free(id);
|
||||||
|
|
||||||
return (i);
|
return (i);
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,7 @@ fdt_lbc_reg_decode(phandle_t node, struct lbc_softc *sc,
|
|||||||
}
|
}
|
||||||
rv = 0;
|
rv = 0;
|
||||||
out:
|
out:
|
||||||
free(regptr, M_OFWPROP);
|
OF_prop_free(regptr);
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -650,11 +650,11 @@ lbc_attach(device_t dev)
|
|||||||
*/
|
*/
|
||||||
lbc_banks_enable(sc);
|
lbc_banks_enable(sc);
|
||||||
|
|
||||||
free(rangesptr, M_OFWPROP);
|
OF_prop_free(rangesptr);
|
||||||
return (bus_generic_attach(dev));
|
return (bus_generic_attach(dev));
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
free(rangesptr, M_OFWPROP);
|
OF_prop_free(rangesptr);
|
||||||
bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mrid, sc->sc_mres);
|
bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mrid, sc->sc_mres);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ iobus_attach(device_t dev)
|
|||||||
iobus_add_reg(child, dinfo, sc->sc_addr);
|
iobus_add_reg(child, dinfo, sc->sc_addr);
|
||||||
device_set_ivars(cdev, dinfo);
|
device_set_ivars(cdev, dinfo);
|
||||||
} else {
|
} else {
|
||||||
free(name, M_OFWPROP);
|
OF_prop_free(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user