stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: c8sectpfe: fix probe device leaks
@ 2025-09-23 15:16 Johan Hovold
  2025-10-27 13:35 ` Johan Hovold
  0 siblings, 1 reply; 5+ messages in thread
From: Johan Hovold @ 2025-09-23 15:16 UTC (permalink / raw)
  To: Patrice Chotard, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Johan Hovold, stable, Peter Griffin

Make sure to drop the references taken to the I2C adapters during probe
on probe failure (e.g. probe deferral) and on driver unbind.

Fixes: c5f5d0f99794 ("[media] c8sectpfe: STiH407/10 Linux DVB demux support")
Cc: stable@vger.kernel.org	# 4.3
Cc: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 .../media/platform/st/sti/c8sectpfe/c8sectpfe-core.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c
index 89bd15a4d26a..3f94d9b4ef1e 100644
--- a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c
+++ b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c
@@ -655,6 +655,13 @@ static irqreturn_t c8sectpfe_error_irq_handler(int irq, void *priv)
 	return IRQ_HANDLED;
 }
 
+static void c8sectpfe_put_device(void *_dev)
+{
+	struct device *dev = _dev;
+
+	put_device(dev);
+}
+
 static int c8sectpfe_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -799,6 +806,11 @@ static int c8sectpfe_probe(struct platform_device *pdev)
 			return -ENODEV;
 		}
 
+		ret = devm_add_action_or_reset(dev, c8sectpfe_put_device,
+					       &tsin->i2c_adapter->dev);
+		if (ret)
+			return ret;
+
 		/* Acquire reset GPIO and activate it */
 		tsin->rst_gpio = devm_fwnode_gpiod_get(dev,
 						       of_fwnode_handle(child),
-- 
2.49.1


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

* Re: [PATCH] media: c8sectpfe: fix probe device leaks
  2025-09-23 15:16 [PATCH] media: c8sectpfe: fix probe device leaks Johan Hovold
@ 2025-10-27 13:35 ` Johan Hovold
  2025-10-27 14:28   ` Patrice CHOTARD
  0 siblings, 1 reply; 5+ messages in thread
From: Johan Hovold @ 2025-10-27 13:35 UTC (permalink / raw)
  To: Patrice Chotard, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, stable, Peter Griffin

On Tue, Sep 23, 2025 at 05:16:05PM +0200, Johan Hovold wrote:
> Make sure to drop the references taken to the I2C adapters during probe
> on probe failure (e.g. probe deferral) and on driver unbind.
> 
> Fixes: c5f5d0f99794 ("[media] c8sectpfe: STiH407/10 Linux DVB demux support")
> Cc: stable@vger.kernel.org	# 4.3
> Cc: Peter Griffin <peter.griffin@linaro.org>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---

Can this one be picked up for 6.19?

Johan

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

* Re: [PATCH] media: c8sectpfe: fix probe device leaks
  2025-10-27 13:35 ` Johan Hovold
@ 2025-10-27 14:28   ` Patrice CHOTARD
  2025-10-27 15:10     ` Peter Griffin
  2025-10-27 15:35     ` Johan Hovold
  0 siblings, 2 replies; 5+ messages in thread
From: Patrice CHOTARD @ 2025-10-27 14:28 UTC (permalink / raw)
  To: Johan Hovold, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, stable, Peter Griffin



On 10/27/25 14:35, Johan Hovold wrote:
> On Tue, Sep 23, 2025 at 05:16:05PM +0200, Johan Hovold wrote:
>> Make sure to drop the references taken to the I2C adapters during probe
>> on probe failure (e.g. probe deferral) and on driver unbind.
>>
>> Fixes: c5f5d0f99794 ("[media] c8sectpfe: STiH407/10 Linux DVB demux support")
>> Cc: stable@vger.kernel.org	# 4.3
>> Cc: Peter Griffin <peter.griffin@linaro.org>
>> Signed-off-by: Johan Hovold <johan@kernel.org>
>> ---
> 
> Can this one be picked up for 6.19?
> 
> Johan


Hi Johan

The removal of c8sectpfe driver has been initiated see https://lore.kernel.org/linux-media/c3a35ad6-c4f6-46ad-9b5b-1fe43385ecc5@foss.st.com/

Regards
Patrice

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

* Re: [PATCH] media: c8sectpfe: fix probe device leaks
  2025-10-27 14:28   ` Patrice CHOTARD
@ 2025-10-27 15:10     ` Peter Griffin
  2025-10-27 15:35     ` Johan Hovold
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Griffin @ 2025-10-27 15:10 UTC (permalink / raw)
  To: Patrice CHOTARD
  Cc: Johan Hovold, Mauro Carvalho Chehab, linux-media, linux-kernel,
	stable

Hi folks,

On Mon, 27 Oct 2025 at 14:34, Patrice CHOTARD
<patrice.chotard@foss.st.com> wrote:
>
>
>
> On 10/27/25 14:35, Johan Hovold wrote:
> > On Tue, Sep 23, 2025 at 05:16:05PM +0200, Johan Hovold wrote:
> >> Make sure to drop the references taken to the I2C adapters during probe
> >> on probe failure (e.g. probe deferral) and on driver unbind.
> >>
> >> Fixes: c5f5d0f99794 ("[media] c8sectpfe: STiH407/10 Linux DVB demux support")
> >> Cc: stable@vger.kernel.org   # 4.3
> >> Cc: Peter Griffin <peter.griffin@linaro.org>
> >> Signed-off-by: Johan Hovold <johan@kernel.org>
> >> ---
> >
> > Can this one be picked up for 6.19?
> >
> > Johan
>
>
> Hi Johan
>
> The removal of c8sectpfe driver has been initiated see https://lore.kernel.org/linux-media/c3a35ad6-c4f6-46ad-9b5b-1fe43385ecc5@foss.st.com/

Interesting, I hadn't seen that. I guess I should dispose of my b2120
board then!

Peter.

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

* Re: [PATCH] media: c8sectpfe: fix probe device leaks
  2025-10-27 14:28   ` Patrice CHOTARD
  2025-10-27 15:10     ` Peter Griffin
@ 2025-10-27 15:35     ` Johan Hovold
  1 sibling, 0 replies; 5+ messages in thread
From: Johan Hovold @ 2025-10-27 15:35 UTC (permalink / raw)
  To: Patrice CHOTARD
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, stable,
	Peter Griffin

On Mon, Oct 27, 2025 at 03:28:57PM +0100, Patrice CHOTARD wrote:
> On 10/27/25 14:35, Johan Hovold wrote:
> > On Tue, Sep 23, 2025 at 05:16:05PM +0200, Johan Hovold wrote:
> >> Make sure to drop the references taken to the I2C adapters during probe
> >> on probe failure (e.g. probe deferral) and on driver unbind.
> >>
> >> Fixes: c5f5d0f99794 ("[media] c8sectpfe: STiH407/10 Linux DVB demux support")
> >> Cc: stable@vger.kernel.org	# 4.3
> >> Cc: Peter Griffin <peter.griffin@linaro.org>
> >> Signed-off-by: Johan Hovold <johan@kernel.org>
> >> ---
> > 
> > Can this one be picked up for 6.19?

> The removal of c8sectpfe driver has been initiated see https://lore.kernel.org/linux-media/c3a35ad6-c4f6-46ad-9b5b-1fe43385ecc5@foss.st.com/

Ah, ok, thanks.

Johan

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

end of thread, other threads:[~2025-10-27 15:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 15:16 [PATCH] media: c8sectpfe: fix probe device leaks Johan Hovold
2025-10-27 13:35 ` Johan Hovold
2025-10-27 14:28   ` Patrice CHOTARD
2025-10-27 15:10     ` Peter Griffin
2025-10-27 15:35     ` Johan Hovold

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).