aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2013-09-25 07:29:54 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-09-26 04:50:08 -0400
commitb1dfee60c8eb35ba74f94d493864f3a55836b603 (patch)
tree8277c2f106a2a2b7c087b71167bb1eb8cbd6697b
parenta13afa4923a02499ff6295dcf5ef700e4baa755a (diff)
video: uvesafb: Remove redundant NULL check
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>
-rw-r--r--drivers/video/uvesafb.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index 7aec6f39fdd5..676a4b9379d9 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -233,8 +233,7 @@ out:
233static void uvesafb_free(struct uvesafb_ktask *task) 233static void uvesafb_free(struct uvesafb_ktask *task)
234{ 234{
235 if (task) { 235 if (task) {
236 if (task->done) 236 kfree(task->done);
237 kfree(task->done);
238 kfree(task); 237 kfree(task);
239 } 238 }
240} 239}
@@ -1332,8 +1331,8 @@ setmode:
1332 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; 1331 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
1333 info->fix.line_length = mode->bytes_per_scan_line; 1332 info->fix.line_length = mode->bytes_per_scan_line;
1334 1333
1335out: if (crtc != NULL) 1334out:
1336 kfree(crtc); 1335 kfree(crtc);
1337 uvesafb_free(task); 1336 uvesafb_free(task);
1338 1337
1339 return err; 1338 return err;
@@ -1793,8 +1792,7 @@ out_mode:
1793 fb_destroy_modedb(info->monspecs.modedb); 1792 fb_destroy_modedb(info->monspecs.modedb);
1794 fb_dealloc_cmap(&info->cmap); 1793 fb_dealloc_cmap(&info->cmap);
1795out: 1794out:
1796 if (par->vbe_modes) 1795 kfree(par->vbe_modes);
1797 kfree(par->vbe_modes);
1798 1796
1799 framebuffer_release(info); 1797 framebuffer_release(info);
1800 return err; 1798 return err;
@@ -1817,12 +1815,9 @@ static int uvesafb_remove(struct platform_device *dev)
1817 fb_dealloc_cmap(&info->cmap); 1815 fb_dealloc_cmap(&info->cmap);
1818 1816
1819 if (par) { 1817 if (par) {
1820 if (par->vbe_modes) 1818 kfree(par->vbe_modes);
1821 kfree(par->vbe_modes); 1819 kfree(par->vbe_state_orig);
1822 if (par->vbe_state_orig) 1820 kfree(par->vbe_state_saved);
1823 kfree(par->vbe_state_orig);
1824 if (par->vbe_state_saved)
1825 kfree(par->vbe_state_saved);
1826 } 1821 }
1827 1822
1828 framebuffer_release(info); 1823 framebuffer_release(info);