[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=V_v11eZ6+3gUwOvdWGNM9owG7zCK5EiezTY7RJ3eaEMw@mail.gmail.com>
Date: Fri, 1 Dec 2023 16:56:08 -0800
From: Doug Anderson <dianders@...omium.org>
To: Chen-Yu Tsai <wenst@...omium.org>
Cc: Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Wolfram Sang <wsa@...nel.org>,
Benson Leung <bleung@...omium.org>,
Tzung-Bi Shih <tzungbi@...nel.org>,
chrome-platform@...ts.linux.dev, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
Johan Hovold <johan@...nel.org>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
andriy.shevchenko@...ux.intel.com, Jiri Kosina <jikos@...nel.org>,
linus.walleij@...aro.org, broonie@...nel.org,
gregkh@...uxfoundation.org, hdegoede@...hat.com,
james.clark@....com, james@...iv.tech, keescook@...omium.org,
rafael@...nel.org, tglx@...utronix.de,
Jeff LaBundy <jeff@...undy.com>, linux-input@...r.kernel.org,
linux-i2c@...r.kernel.org
Subject: Re: [RFC PATCH v3 1/5] of: dynamic: Add of_changeset_update_prop_string
Hi,
On Tue, Nov 28, 2023 at 12:45 AM Chen-Yu Tsai <wenst@...omium.org> wrote:
>
> @@ -1039,3 +1039,50 @@ int of_changeset_add_prop_u32_array(struct of_changeset *ocs,
> return ret;
> }
> EXPORT_SYMBOL_GPL(of_changeset_add_prop_u32_array);
> +
> +static int of_changeset_update_prop_helper(struct of_changeset *ocs,
> + struct device_node *np,
> + const struct property *pp)
> +{
> + struct property *new_pp;
> + int ret;
> +
> + new_pp = __of_prop_dup(pp, GFP_KERNEL);
> + if (!new_pp)
> + return -ENOMEM;
> +
> + ret = of_changeset_update_property(ocs, np, new_pp);
> + if (ret) {
> + kfree(new_pp->name);
> + kfree(new_pp->value);
> + kfree(new_pp);
Given that this is the 3rd copy of the freeing logic, does it make
sense to make __of_prop_free() that's documented to free what was
returned by __of_prop_dupe()?
Powered by blists - more mailing lists