[media] mantis: cleanup NULL checking in mantis_ca_exit()
Smatch complainst that the call to mantis_evmgr_exit() dereferences "ca" but then we check it for NULL on the next line. I've moved the NULL check forward to avoid that. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
081416e62d
commit
1d6ca29db8
@@ -198,10 +198,11 @@ void mantis_ca_exit(struct mantis_pci *mantis)
|
|||||||
struct mantis_ca *ca = mantis->mantis_ca;
|
struct mantis_ca *ca = mantis->mantis_ca;
|
||||||
|
|
||||||
dprintk(MANTIS_DEBUG, 1, "Mantis CA exit");
|
dprintk(MANTIS_DEBUG, 1, "Mantis CA exit");
|
||||||
|
if (!ca)
|
||||||
|
return;
|
||||||
|
|
||||||
mantis_evmgr_exit(ca);
|
mantis_evmgr_exit(ca);
|
||||||
dprintk(MANTIS_ERROR, 1, "Unregistering EN50221 device");
|
dprintk(MANTIS_ERROR, 1, "Unregistering EN50221 device");
|
||||||
if (ca)
|
|
||||||
dvb_ca_en50221_release(&ca->en50221);
|
dvb_ca_en50221_release(&ca->en50221);
|
||||||
|
|
||||||
kfree(ca);
|
kfree(ca);
|
||||||
|
Reference in New Issue
Block a user