]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
[media] mantis: fix silly crash case
authorAlan Cox <alan@linux.intel.com>
Thu, 9 Aug 2012 15:33:52 +0000 (12:33 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 12 Aug 2012 15:22:43 +0000 (12:22 -0300)
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.

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=16473

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/mantis/mantis_dvb.c

index e5180e45d3100e72d8b0bb26758beccdca5a4b6d..5d15c6b74d9be621bb5cb8fecfae9ad50512804f 100644 (file)
@@ -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);