[PATCH] media: dvb-frontends: helene: Fix double free on release

From: Can Peng

Date: Wed Jul 01 2026 - 04:33:08 EST


helene_probe() allocates priv with devm_kzalloc() and stores it in
fe->tuner_priv. It also installs helene_tuner_ops, whose release callback
frees fe->tuner_priv with kfree(). If the frontend release path runs, the
devm allocation can be freed manually and later again by devres.

The legacy attach paths still use regular allocations and need
helene_release(), so keep the callback for those paths. For the i2c-managed
probe path, clear the copied release callback, matching other tuner drivers
such as mt2060.

Fixes: 817dc4b579d8 ("media: helene: add I2C device probe function")
Signed-off-by: Can Peng <pengcan@xxxxxxxxxx>
---
drivers/media/dvb-frontends/helene.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/dvb-frontends/helene.c b/drivers/media/dvb-frontends/helene.c
index 993280fefc2c..8cf6e1823605 100644
--- a/drivers/media/dvb-frontends/helene.c
+++ b/drivers/media/dvb-frontends/helene.c
@@ -1091,6 +1091,7 @@ static int helene_probe(struct i2c_client *client)

memcpy(&fe->ops.tuner_ops, &helene_tuner_ops,
sizeof(struct dvb_tuner_ops));
+ fe->ops.tuner_ops.release = NULL;
fe->tuner_priv = priv;
i2c_set_clientdata(client, priv);

--
2.53.0