Skip to content

Commit

Permalink
[media] mantis: cleanup NULL checking in mantis_ca_exit()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Dec 27, 2012
1 parent 081416e commit 1d6ca29
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/media/pci/mantis/mantis_ca.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1d6ca29

Please sign in to comment.