video: uvesafb: Deletion of an unnecessary check before the function call "platform_d...
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 23 Nov 2014 16:05:18 +0000 (17:05 +0100)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 4 Dec 2014 14:16:02 +0000 (16:16 +0200)
The platform_device_put() 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: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/uvesafb.c

index f718627b368f23a247e4af55323f9e8cbc8e2fa0..d32d1c4d1b99f81a1962bb92bf7cc6b3e1ad77ff 100644 (file)
@@ -1922,8 +1922,7 @@ static int uvesafb_init(void)
                        err = -ENOMEM;
 
                if (err) {
-                       if (uvesafb_device)
-                               platform_device_put(uvesafb_device);
+                       platform_device_put(uvesafb_device);
                        platform_driver_unregister(&uvesafb_driver);
                        cn_del_callback(&uvesafb_cn_id);
                        return err;