Skip to content

Commit

Permalink
video: uvesafb: Deletion of an unnecessary check before the function …
Browse files Browse the repository at this point in the history
…call "platform_device_put"

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>
  • Loading branch information
Markus Elfring authored and Tomi Valkeinen committed Dec 4, 2014
1 parent 7728495 commit 3468562
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/video/fbdev/uvesafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3468562

Please sign in to comment.