* [patch] [media] mantis: cleanup NULL checking in mantis_ca_exit()
@ 2012-12-02 10:43 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-12-02 10:43 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: linux-media, kernel-janitors
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>
---
There aren't any callers for this function. It is commented out in
mantis_dvb_exit().
diff --git a/drivers/media/pci/mantis/mantis_ca.c b/drivers/media/pci/mantis/mantis_ca.c
index 3d70469..60c6c2f 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);
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-12-02 10:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-02 10:43 [patch] [media] mantis: cleanup NULL checking in mantis_ca_exit() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox