diff options
author | gonzo <gonzo@FreeBSD.org> | 2016-05-11 18:20:02 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2016-05-11 18:20:02 +0000 |
commit | 23a2d5f59362b8a60462708280c89083bb8d1b27 (patch) | |
tree | 3563d72b1347b885dce8a7a9c1acc2cd41747fe8 /sys/dev/fdt/fdt_common.c | |
parent | 8093b741c766ae4c82afcd7999ff372061614b25 (diff) | |
download | FreeBSD-src-23a2d5f59362b8a60462708280c89083bb8d1b27.zip FreeBSD-src-23a2d5f59362b8a60462708280c89083bb8d1b27.tar.gz |
Add OF_prop_free function as a counterpart for OF_*prop_alloc
- Introduce new OF API function OF_prop_free to free memory allocated by
OF_getprop_alloc and OF_getencprop_alloc. Current code just calls free(9)
with M_OFWPROP memory class which assumes knowledge about OF_*prop_alloc
functions' internals and leads to unneccessary code coupling
- Convert some of the free(..., M_OFWPROP) instances to OF_prop_free
Files affected by this commit are the ones I was able to test on real
hardware. The rest of free(..., M_OFWPROP) instances will be handled with
idividual maintainers
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D6315
Diffstat (limited to 'sys/dev/fdt/fdt_common.c')
-rw-r--r-- | sys/dev/fdt/fdt_common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/fdt/fdt_common.c b/sys/dev/fdt/fdt_common.c index 73f7ada..4e0d6e2 100644 --- a/sys/dev/fdt/fdt_common.c +++ b/sys/dev/fdt/fdt_common.c @@ -348,7 +348,7 @@ fdt_is_enabled(phandle_t node) if (strncmp((char *)stat, "okay", len) == 0) ena = 1; - free(stat, M_OFWPROP); + OF_prop_free(stat); return (ena); } @@ -519,7 +519,7 @@ fdt_reg_to_rl(phandle_t node, struct resource_list *rl) rv = 0; out: - free(regptr, M_OFWPROP); + OF_prop_free(regptr); return (rv); } @@ -734,4 +734,4 @@ fdt_get_chosen_bootargs(char *bootargs, size_t max_size) if (OF_getprop(chosen, "bootargs", bootargs, max_size) == -1) return (ENXIO); return (0); -}
\ No newline at end of file +} |