summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/drxk_hard.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab2011-07-10 15:26:06 +0200
committerMauro Carvalho Chehab2011-07-27 22:55:50 +0200
commitcf694b141ea2973179756fd572dd5cdd064e1abf (patch)
tree47aabe92cdf1dad9f08f15e5c07e79ef50930427 /drivers/media/dvb/frontends/drxk_hard.c
parent[media] drxk: Improves the UIO handling (diff)
downloadkernel-qcow2-linux-cf694b141ea2973179756fd572dd5cdd064e1abf.tar.gz
kernel-qcow2-linux-cf694b141ea2973179756fd572dd5cdd064e1abf.tar.xz
kernel-qcow2-linux-cf694b141ea2973179756fd572dd5cdd064e1abf.zip
[media] drxk: Fix driver removal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/drxk_hard.c')
-rw-r--r--drivers/media/dvb/frontends/drxk_hard.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c
index aaef8e35698b..7ea73dfacdfb 100644
--- a/drivers/media/dvb/frontends/drxk_hard.c
+++ b/drivers/media/dvb/frontends/drxk_hard.c
@@ -6431,6 +6431,18 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config,
if (init_drxk(state) < 0)
goto error;
*fe_t = &state->t_frontend;
+
+#ifdef CONFIG_MEDIA_ATTACH
+ /*
+ * HACK: As this function initializes both DVB-T and DVB-C fe symbols,
+ * and calling it twice would create the state twice, leading into
+ * memory leaks, the right way is to call it only once. However, dvb
+ * release functions will call symbol_put twice. So, the solution is to
+ * artificially increment the usage count, in order to allow the
+ * driver to be released.
+ */
+ symbol_get(drxk_attach);
+#endif
return &state->c_frontend;
error: