[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4989387.31r3eYUQgx@steina-w>
Date: Fri, 31 Jan 2025 14:50:46 +0100
From: Alexander Stein <alexander.stein@...tq-group.com>
To: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>, Pengutronix Kernel Team <kernel@...gutronix.de>, Fabio Estevam <festevam@...il.com>, Srinivas Kandagatla <srinivas.kandagatla@...aro.org>, Krzysztof Kozlowski <krzk@...nel.org>
Cc: devicetree@...r.kernel.org, imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] nvmem: imx-ocotp: Support accessing controller for i.MX8M Nano
Hi,
Am Freitag, 31. Januar 2025, 08:20:40 CET schrieb Krzysztof Kozlowski:
> On 30/01/2025 14:01, Alexander Stein wrote:
> > +
> > +static int imx_ocotp_grant_access(struct ocotp_priv *priv, struct device_node *parent)
> > +{
> > + struct device *dev = priv->dev;
> > +
> > + for_each_available_child_of_node_scoped(parent, child) {
> > + struct of_phandle_args args;
> > + u32 id, idx = 0;
> > +
> > + while (!of_parse_phandle_with_args(child, "access-controllers",
> > + "#access-controller-cells",
> > + idx++, &args)) {
> > + of_node_put(args.np);
> > + if (args.np != dev->of_node)
>
> You are using args.np after dropping the reference.
Indeed, but is it really a problem? The args.np pointer is still the same.
So the comparison is unaffected.
Both branches need to drop the reference, no?
But the following looks awefull as well.
> if (args.np != dev->of_node) {
> of_node_put(args.np);
> continue;
> }
> of_node_put(args.np);
Best regards,
Alexander
>
> > + continue;
> > +
> > + /* Only support one cell */
> > + if (args.args_count != 1) {
> > + dev_err(dev, "wrong args count\n");
> > + continue;
> > + }
> > +
>
>
> Best regards,
> Krzysztof
>
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
Powered by blists - more mailing lists