Re: [PATCH next] of: dynamic: Fix use after free in of_changeset_add_prop_helper()
From: Rob Herring (Arm)
Date: Fri Aug 22 2025 - 16:42:19 EST
On Fri, 22 Aug 2025 11:08:46 +0300, Dan Carpenter wrote:
> If the of_changeset_add_property() function call fails, then this code
> frees "new_pp" and then dereference it on the next line. Return the
> error code directly instead.
>
> Fixes: c81f6ce16785 ("of: dynamic: Fix memleak when of_pci_add_properties() failed")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
> drivers/of/dynamic.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
Applied, thanks!