[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140305155418.GA32106@udknight>
Date: Wed, 5 Mar 2014 23:54:18 +0800
From: Wang YanQing <udknight@...il.com>
To: tomi.valkeinen@...com
Cc: plagnioj@...osoft.com, linux-fbdev@...r.kernel.org,
linux-kernel@...r.kernel.org, fengguang.wu@...el.com
Subject: [PATCH] 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@...el.com
"drivers/video/fbdev/uvesafb.c:1815 uvesafb_remove()
warn: variable dereferenced before check 'par'" ]
Signed-off-by: Wang YanQing <udknight@...il.com>
---
drivers/video/fbdev/uvesafb.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 1f38445..18352b2 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/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);
}
--
1.8.3.4.8.g69490f3.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists