summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/mantis/mantis_ca.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-12-02 10:43:13 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-12-27 23:25:38 +0100
commit1d6ca29db8b1f213de880b10ac28aed0a19c1d4a (patch)
tree61601634e9ce7d83fcc234d4683a00e007dfdcb9 /drivers/media/pci/mantis/mantis_ca.c
parent[media] TeVii DVB-S s421 and s632 cards support, rs2000 part (diff)
downloadlinux-1d6ca29db8b1f213de880b10ac28aed0a19c1d4a.tar.xz
linux-1d6ca29db8b1f213de880b10ac28aed0a19c1d4a.zip
[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>
Diffstat (limited to '')
-rw-r--r--drivers/media/pci/mantis/mantis_ca.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/pci/mantis/mantis_ca.c b/drivers/media/pci/mantis/mantis_ca.c
index 3d7046909009..60c6c2f24066 100644
--- a/drivers/media/pci/mantis/mantis_ca.c
+++ b/drivers/media/pci/mantis/mantis_ca.c
@@ -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);
}