mantis: fix silly crash case
PATCH 1/1 mantis: fix silly crash case
From: Alan Cox <[email protected]>
If we set mantis->fe to NULL on an error its not a good idea to then try passing NULL to the unregister paths and oopsing really.
Signed-off-by Alan Cox <[email protected]>
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=16473
---
drivers/media/dvb/mantis/mantis_dvb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/media/dvb/mantis/mantis_dvb.c +4 -2
@@ -248,8 +248,10 @@ int __devinit mantis_dvb_init(struct mantis_pci *mantis) err5:tasklet_kill (&mantis->tasklet);dvb_net_release (&mantis->dvbnet); -dvb_unregister_frontend (mantis->fe); -dvb_frontend_detach (mantis->fe); +if (mantis->fe) { +dvb_unregister_frontend (mantis->fe); +dvb_frontend_detach (mantis->fe); + } err4: mantis->demux.dmx.remove_frontend (&mantis->demux.dmx, &mantis->fe_mem);