[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250225144108.GB2279028-robh@kernel.org>
Date: Tue, 25 Feb 2025 08:41:08 -0600
From: Rob Herring <robh@...nel.org>
To: Zijun Hu <zijun_hu@...oud.com>
Cc: Saravana Kannan <saravanak@...gle.com>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Zijun Hu <quic_zijuhu@...cinc.com>
Subject: Re: [PATCH 4/5] of: Do not change property state under
__of_add_property() failure
On Mon, Feb 24, 2025 at 10:28:00PM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@...cinc.com>
>
> Do not remove the property from list @np->deadprops if
> __of_add_property() encounters -EEXIST failure.
A property can never be on both np->deadprops and np->props.
>
> Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
> ---
> drivers/of/base.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index c810014957e81171675b63f25eaabe391cc903e4..47cae6e48a48a7e1312c25fc5267bcf39102bbe9 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1646,9 +1646,6 @@ int __of_add_property(struct device_node *np, struct property *prop)
>
> raw_spin_lock_irqsave(&devtree_lock, flags);
>
> - __of_remove_property_from_list(&np->deadprops, prop);
> -
> - prop->next = NULL;
> next = &np->properties;
> while (*next) {
> if (of_prop_cmp(prop->name, (*next)->name) == 0) {
> @@ -1660,6 +1657,9 @@ int __of_add_property(struct device_node *np, struct property *prop)
> }
> *next = prop;
>
> + __of_remove_property_from_list(&np->deadprops, prop);
> + prop->next = NULL;
> +
> out_unlock:
> raw_spin_unlock_irqrestore(&devtree_lock, flags);
> if (rc)
>
> --
> 2.34.1
>
Powered by blists - more mailing lists