Commit b1dfee60 authored by Sachin Kamat's avatar Sachin Kamat Committed by Tomi Valkeinen

video: uvesafb: Remove redundant NULL check

kfree on a NULL pointer is a no-op.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Cc: Michal Januszewski <spock@gentoo.org>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent a13afa49
...@@ -233,8 +233,7 @@ static int uvesafb_exec(struct uvesafb_ktask *task) ...@@ -233,8 +233,7 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
static void uvesafb_free(struct uvesafb_ktask *task) static void uvesafb_free(struct uvesafb_ktask *task)
{ {
if (task) { if (task) {
if (task->done) kfree(task->done);
kfree(task->done);
kfree(task); kfree(task);
} }
} }
...@@ -1332,8 +1331,8 @@ static int uvesafb_set_par(struct fb_info *info) ...@@ -1332,8 +1331,8 @@ static int uvesafb_set_par(struct fb_info *info)
FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
info->fix.line_length = mode->bytes_per_scan_line; info->fix.line_length = mode->bytes_per_scan_line;
out: if (crtc != NULL) out:
kfree(crtc); kfree(crtc);
uvesafb_free(task); uvesafb_free(task);
return err; return err;
...@@ -1793,8 +1792,7 @@ static int uvesafb_probe(struct platform_device *dev) ...@@ -1793,8 +1792,7 @@ static int uvesafb_probe(struct platform_device *dev)
fb_destroy_modedb(info->monspecs.modedb); fb_destroy_modedb(info->monspecs.modedb);
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
out: out:
if (par->vbe_modes) kfree(par->vbe_modes);
kfree(par->vbe_modes);
framebuffer_release(info); framebuffer_release(info);
return err; return err;
...@@ -1817,12 +1815,9 @@ static int uvesafb_remove(struct platform_device *dev) ...@@ -1817,12 +1815,9 @@ static int uvesafb_remove(struct platform_device *dev)
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
if (par) { if (par) {
if (par->vbe_modes) kfree(par->vbe_modes);
kfree(par->vbe_modes); kfree(par->vbe_state_orig);
if (par->vbe_state_orig) kfree(par->vbe_state_saved);
kfree(par->vbe_state_orig);
if (par->vbe_state_saved)
kfree(par->vbe_state_saved);
} }
framebuffer_release(info); framebuffer_release(info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment