]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] mantis: cleanup NULL checking in mantis_ca_exit()
authorDan Carpenter <dan.carpenter@oracle.com>
Sun, 2 Dec 2012 09:43:13 +0000 (06:43 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 27 Dec 2012 22:25:38 +0000 (20:25 -0200)
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>
drivers/media/pci/mantis/mantis_ca.c

index 3d70469090092af7a3d8f6145b8a753a0dfacf47..60c6c2f24066bf96b6be5be45e0810fa466814bb 100644 (file)
@@ -198,11 +198,12 @@ void mantis_ca_exit(struct mantis_pci *mantis)
        struct mantis_ca *ca = mantis->mantis_ca;
 
        dprintk(MANTIS_DEBUG, 1, "Mantis CA exit");
+       if (!ca)
+               return;
 
        mantis_evmgr_exit(ca);
        dprintk(MANTIS_ERROR, 1, "Unregistering EN50221 device");
-       if (ca)
-               dvb_ca_en50221_release(&ca->en50221);
+       dvb_ca_en50221_release(&ca->en50221);
 
        kfree(ca);
 }