Skip to contentSkip to conversation

media: c8sectpfe: fix probe device leaks

PATCH In review Johan Hovold 3 participants 5 messages Sep 23, 2025 – Oct 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: c8sectpfe: fix probe device leaks

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 Peter Griffin <[email protected]>
---
 .../media/platform/st/sti/c8sectpfe/c8sectpfe-core.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c +12 -0
index 89bd15a4d26a..3f94d9b4ef1e 100644
@@ -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),
Signature · 1 line
2.49.1
#2 lore raw
Quoted 10 lines · Johan Hovold
Quoted 8 lines · Johan Hovold

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 Peter Griffin <[email protected]>

---

Quoted 3 lines

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/[email protected]/

Regards
Patrice

#3 lore raw

Hi folks,

Quoted 14 lines · Patrice CHOTARD
Quoted 10 lines · Johan Hovold
Quoted 8 lines · Johan Hovold

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 Peter Griffin <[email protected]>

---

Quoted 8 lines
Quoted 3 lines

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/[email protected]/

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

Peter.

#4 lore raw
In reply to Patrice CHOTARD
Quoted 11 lines · Patrice CHOTARD
Quoted 10 lines · Johan Hovold
Quoted 8 lines · Johan Hovold

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 Peter Griffin <[email protected]>

---

Quoted 3 lines
Quoted 1 line

Can this one be picked up for 6.19?

The removal of c8sectpfe driver has been initiated see https://lore.kernel.org/linux-media/[email protected]/

Ah, ok, thanks.

Johan