[media] DVB: Delete an unnecessary check before the function call "dvb_unregister_device"
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 3 Feb 2015 15:01:40 +0000 (12:01 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 8 Apr 2015 10:40:53 +0000 (07:40 -0300)
The dvb_unregister_device() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-core/dvb_ca_en50221.c

index 55a217f0ad0e670da0ef14f96bf0a3d397742cd3..7a9dd25a4cce05a7ccf151ed029fd1aef3fa53fb 100644 (file)
@@ -1728,8 +1728,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
 
 error:
        if (ca != NULL) {
-               if (ca->dvbdev != NULL)
-                       dvb_unregister_device(ca->dvbdev);
+               dvb_unregister_device(ca->dvbdev);
                kfree(ca->slot_info);
                kfree(ca);
        }