Skip to content

Commit

Permalink
[media] tm6000-dvb: Fix module unload
Browse files Browse the repository at this point in the history
dvb_unregister_frontend has to be called before detach. Otherwise the
unregister call will segfault. This made tm6000-dvb module unload unusable.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Julian Scheel authored and Mauro Carvalho Chehab committed Dec 21, 2012
1 parent afc2e8a commit afca99a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/usb/tm6000/tm6000-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ static int register_dvb(struct tm6000_core *dev)
dvb_dmx_release(&dvb->demux);
frontend_err:
if (dvb->frontend) {
dvb_frontend_detach(dvb->frontend);
dvb_unregister_frontend(dvb->frontend);
dvb_frontend_detach(dvb->frontend);
}
adapter_err:
dvb_unregister_adapter(&dvb->adapter);
Expand All @@ -384,8 +384,8 @@ static void unregister_dvb(struct tm6000_core *dev)

/* mutex_lock(&tm6000_driver.open_close_mutex); */
if (dvb->frontend) {
dvb_frontend_detach(dvb->frontend);
dvb_unregister_frontend(dvb->frontend);
dvb_frontend_detach(dvb->frontend);
}

dvb_dmxdev_release(&dvb->dmxdev);
Expand Down

0 comments on commit afca99a

Please sign in to comment.