From: Wang YanQing Date: Wed, 5 Mar 2014 15:54:18 +0000 (+0800) Subject: video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a57aa93f44f34ce6e3b3ed0b114d5eea46234aef;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove Because uvesafb_par is allocated as part of fb_info in uvesafb_probe, so we don't need to do NULL check for both fb_info and uvesafb_par in uvesafb_remove. [ This patch also fix a warning report by fengguang.wu@intel.com "drivers/video/fbdev/uvesafb.c:1815 uvesafb_remove() warn: variable dereferenced before check 'par'" ] Signed-off-by: Wang YanQing Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index 256fba7f4641..70a02a2d60bf 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -1812,11 +1812,9 @@ static int uvesafb_remove(struct platform_device *dev) fb_destroy_modedb(info->monspecs.modedb); fb_dealloc_cmap(&info->cmap); - if (par) { - kfree(par->vbe_modes); - kfree(par->vbe_state_orig); - kfree(par->vbe_state_saved); - } + kfree(par->vbe_modes); + kfree(par->vbe_state_orig); + kfree(par->vbe_state_saved); framebuffer_release(info); }