Re: [PATCH 1/2] of: Return copy of live tree as fixed tree

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

 



Hi,

On 22.03.21 12:24, Sascha Hauer wrote:
> the of fixups modify the the tree passed to them. It is undesired that
> these modify the live tree, so when we are requested to return the fixed
> live tree then make a copy first.
> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> ---
>  common/oftree.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/oftree.c b/common/oftree.c
> index 075b9d6b8b..4868d8812e 100644
> --- a/common/oftree.c
> +++ b/common/oftree.c
> @@ -325,6 +325,9 @@ struct fdt_header *of_get_fixed_tree(struct device_node *node)
>  		node = of_get_root_node();
>  		if (!node)
>  			return NULL;
> +		node = of_copy_node(NULL, node);
> +		if (!node)
> +			return NULL;

Shouldn't this be freed somewhere?

>  	}
>  
>  	ret = of_fix_tree(node);
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux