[PATCH v3 3/3] bootconfig: Free xbc_data in xbc_destroy_all()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Free xbc_data memory in xbc_destroy_all() with other data.
Note that this changes the ownership of the passed bootconfig
data.

Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
---
 lib/bootconfig.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/bootconfig.c b/lib/bootconfig.c
index 5ae248b29373..2ba7d945adc9 100644
--- a/lib/bootconfig.c
+++ b/lib/bootconfig.c
@@ -789,6 +789,7 @@ static int __init xbc_verify_tree(void)
  */
 void __init xbc_destroy_all(void)
 {
+	memblock_free_ptr(xbc_data, xbc_data_size);
 	xbc_data = NULL;
 	xbc_data_size = 0;
 	xbc_node_num = 0;
@@ -810,6 +811,8 @@ void __init xbc_destroy_all(void)
  * In error cases, @emsg will be updated with an error message and
  * @epos will be updated with the error position which is the byte offset
  * of @buf. If the error is not a parser error, @epos will be -1.
+ * Note that the @buf ownership is transferred, so it will be freed
+ * in xbc_destroy_all().
  */
 int __init xbc_init(char *buf, const char **emsg, int *epos)
 {






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux