Skip to content

Commit

Permalink
[media] drxk: Fix driver removal
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed Jul 27, 2011
1 parent 90796ac commit cf694b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/media/dvb/frontends/drxk_hard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cf694b1

Please sign in to comment.