linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] reset: eyeq: fix OF node leak
@ 2025-07-08  8:56 Johan Hovold
  2025-08-27  9:48 ` Johan Hovold
  2025-08-27 13:49 ` Philipp Zabel
  0 siblings, 2 replies; 4+ messages in thread
From: Johan Hovold @ 2025-07-08  8:56 UTC (permalink / raw)
  To: Vladimir Kondratiev, Gregory CLEMENT, Théo Lebrun,
	Philipp Zabel
  Cc: linux-mips, linux-kernel, Johan Hovold

Make sure to drop the OF node reference taken when probing the auxiliary
device when the device is later unbound.

Fixes: 487b1b32e317 ("reset: eyeq: add platform driver")
Cc: Théo Lebrun <theo.lebrun@bootlin.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/reset/reset-eyeq.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/reset/reset-eyeq.c b/drivers/reset/reset-eyeq.c
index 02d50041048b..2d3998368a1c 100644
--- a/drivers/reset/reset-eyeq.c
+++ b/drivers/reset/reset-eyeq.c
@@ -410,6 +410,13 @@ static int eqr_of_xlate_twocells(struct reset_controller_dev *rcdev,
 	return eqr_of_xlate_internal(rcdev, reset_spec->args[0], reset_spec->args[1]);
 }
 
+static void eqr_of_node_put(void *_dev)
+{
+	struct device *dev = _dev;
+
+	of_node_put(dev->of_node);
+}
+
 static int eqr_probe(struct auxiliary_device *adev,
 		     const struct auxiliary_device_id *id)
 {
@@ -428,6 +435,10 @@ static int eqr_probe(struct auxiliary_device *adev,
 	if (!dev->of_node)
 		return -ENODEV;
 
+	ret = devm_add_action_or_reset(dev, eqr_of_node_put, dev);
+	if (ret)
+		return ret;
+
 	/*
 	 * Using our newfound OF node, we can get match data. We cannot use
 	 * device_get_match_data() because it does not match reused OF nodes.
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] reset: eyeq: fix OF node leak
  2025-07-08  8:56 [PATCH] reset: eyeq: fix OF node leak Johan Hovold
@ 2025-08-27  9:48 ` Johan Hovold
  2025-08-27 14:41   ` Philipp Zabel
  2025-08-27 13:49 ` Philipp Zabel
  1 sibling, 1 reply; 4+ messages in thread
From: Johan Hovold @ 2025-08-27  9:48 UTC (permalink / raw)
  To: Vladimir Kondratiev, Gregory CLEMENT, Théo Lebrun,
	Philipp Zabel
  Cc: linux-mips, linux-kernel

On Tue, Jul 08, 2025 at 10:56:13AM +0200, Johan Hovold wrote:
> Make sure to drop the OF node reference taken when probing the auxiliary
> device when the device is later unbound.
> 
> Fixes: 487b1b32e317 ("reset: eyeq: add platform driver")
> Cc: Théo Lebrun <theo.lebrun@bootlin.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>

Can this one be picked up?

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] reset: eyeq: fix OF node leak
  2025-07-08  8:56 [PATCH] reset: eyeq: fix OF node leak Johan Hovold
  2025-08-27  9:48 ` Johan Hovold
@ 2025-08-27 13:49 ` Philipp Zabel
  1 sibling, 0 replies; 4+ messages in thread
From: Philipp Zabel @ 2025-08-27 13:49 UTC (permalink / raw)
  To: Johan Hovold, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun
  Cc: linux-mips, linux-kernel

On Di, 2025-07-08 at 10:56 +0200, Johan Hovold wrote:
> Make sure to drop the OF node reference taken when probing the auxiliary
> device when the device is later unbound.
> 
> Fixes: 487b1b32e317 ("reset: eyeq: add platform driver")
> Cc: Théo Lebrun <theo.lebrun@bootlin.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] reset: eyeq: fix OF node leak
  2025-08-27  9:48 ` Johan Hovold
@ 2025-08-27 14:41   ` Philipp Zabel
  0 siblings, 0 replies; 4+ messages in thread
From: Philipp Zabel @ 2025-08-27 14:41 UTC (permalink / raw)
  To: Johan Hovold, Vladimir Kondratiev, Gregory CLEMENT,
	Théo Lebrun
  Cc: linux-mips, linux-kernel

On Mi, 2025-08-27 at 11:48 +0200, Johan Hovold wrote:
> On Tue, Jul 08, 2025 at 10:56:13AM +0200, Johan Hovold wrote:
> > Make sure to drop the OF node reference taken when probing the auxiliary
> > device when the device is later unbound.
> > 
> > Fixes: 487b1b32e317 ("reset: eyeq: add platform driver")
> > Cc: Théo Lebrun <theo.lebrun@bootlin.com>
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> 
> Can this one be picked up?

Thank you for the reminder, applied to reset/fixes.

[1/1] reset: eyeq: fix OF node leak
      https://git.pengutronix.de/cgit/pza/linux/commit/?id=9a52827a9bbb

regards
Philipp


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-27 14:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08  8:56 [PATCH] reset: eyeq: fix OF node leak Johan Hovold
2025-08-27  9:48 ` Johan Hovold
2025-08-27 14:41   ` Philipp Zabel
2025-08-27 13:49 ` Philipp Zabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).