video: uvesafb: Remove redundant NULL check
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 25 Sep 2013 11:29:54 +0000 (16:59 +0530)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 26 Sep 2013 08:50:08 +0000 (11:50 +0300)
kfree on a NULL pointer is a no-op.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Michal Januszewski <spock@gentoo.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/uvesafb.c

index 7aec6f39fdd5461beb16d700ed201212ba9d1704..676a4b9379d9c95b7d38f5c6f61c0688584a18bd 100644 (file)
@@ -233,8 +233,7 @@ out:
 static void uvesafb_free(struct uvesafb_ktask *task)
 {
        if (task) {
-               if (task->done)
-                       kfree(task->done);
+               kfree(task->done);
                kfree(task);
        }
 }
@@ -1332,8 +1331,8 @@ setmode:
                                FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
        info->fix.line_length = mode->bytes_per_scan_line;
 
-out:   if (crtc != NULL)
-               kfree(crtc);
+out:
+       kfree(crtc);
        uvesafb_free(task);
 
        return err;
@@ -1793,8 +1792,7 @@ out_mode:
        fb_destroy_modedb(info->monspecs.modedb);
        fb_dealloc_cmap(&info->cmap);
 out:
-       if (par->vbe_modes)
-               kfree(par->vbe_modes);
+       kfree(par->vbe_modes);
 
        framebuffer_release(info);
        return err;
@@ -1817,12 +1815,9 @@ static int uvesafb_remove(struct platform_device *dev)
                fb_dealloc_cmap(&info->cmap);
 
                if (par) {
-                       if (par->vbe_modes)
-                               kfree(par->vbe_modes);
-                       if (par->vbe_state_orig)
-                               kfree(par->vbe_state_orig);
-                       if (par->vbe_state_saved)
-                               kfree(par->vbe_state_saved);
+                       kfree(par->vbe_modes);
+                       kfree(par->vbe_state_orig);
+                       kfree(par->vbe_state_saved);
                }
 
                framebuffer_release(info);