summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkihiro Tsukada <tskd08@gmail.com>2018-06-10 17:49:15 +0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-30 15:51:06 +0300
commitf917fc0e9b9988982a841b871655cc41bde1e10e (patch)
tree397ca487f40cf1f5f5c90253287db905329c27dc
parentb30cc07de8a903685441f9770b1b21e1422d2468 (diff)
downloadlinux-f917fc0e9b9988982a841b871655cc41bde1e10e.tar.xz
media: dvb-frontends/dvb-pll: fix module ref-counting
dvb-pll module was 'put' twice on exit: once by dvb_frontend_detach() and another by dvb_module_release(). Signed-off-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--drivers/media/dvb-frontends/dvb-pll.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c
index e3894ff403d7..4a663420190e 100644
--- a/drivers/media/dvb-frontends/dvb-pll.c
+++ b/drivers/media/dvb-frontends/dvb-pll.c
@@ -884,6 +884,17 @@ dvb_pll_probe(struct i2c_client *client, const struct i2c_device_id *id)
if (!dvb_pll_attach(fe, client->addr, client->adapter, desc_id))
return -ENOMEM;
+ /*
+ * Unset tuner_ops.release (== dvb_pll_release)
+ * which has been just set in the above dvb_pll_attach(),
+ * because if tuner_ops.release was left defined,
+ * this module would be 'put' twice on exit:
+ * once by dvb_frontend_detach() and another by dvb_module_release().
+ *
+ * dvb_pll_release is instead executed in the i2c driver's .remove(),
+ * keeping dvb_pll_attach untouched for legacy (dvb_attach) drivers.
+ */
+ fe->ops.tuner_ops.release = NULL;
dev_info(&client->dev, "DVB Simple Tuner attached.\n");
return 0;
}