aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2014-11-23 05:40:47 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-12-04 09:16:01 -0500
commit177c0386ea5beb5b8c73d7dbde41487f3f4eabf4 (patch)
tree2cc78de059adb95159465667a7cc2346ddaf079f
parente87d9f295a7f3e9e7aae7a64f8fa9b45ceb1bf1c (diff)
video: udlfb: Deletion of unnecessary checks before the function call "vfree"
The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/fbdev/udlfb.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index 046d51d83d74..ff2b8731a2dc 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -922,8 +922,7 @@ static void dlfb_free(struct kref *kref)
922{ 922{
923 struct dlfb_data *dev = container_of(kref, struct dlfb_data, kref); 923 struct dlfb_data *dev = container_of(kref, struct dlfb_data, kref);
924 924
925 if (dev->backing_buffer) 925 vfree(dev->backing_buffer);
926 vfree(dev->backing_buffer);
927 926
928 kfree(dev->edid); 927 kfree(dev->edid);
929 928
@@ -953,8 +952,7 @@ static void dlfb_free_framebuffer(struct dlfb_data *dev)
953 fb_dealloc_cmap(&info->cmap); 952 fb_dealloc_cmap(&info->cmap);
954 if (info->monspecs.modedb) 953 if (info->monspecs.modedb)
955 fb_destroy_modedb(info->monspecs.modedb); 954 fb_destroy_modedb(info->monspecs.modedb);
956 if (info->screen_base) 955 vfree(info->screen_base);
957 vfree(info->screen_base);
958 956
959 fb_destroy_modelist(&info->modelist); 957 fb_destroy_modelist(&info->modelist);
960 958
@@ -1203,8 +1201,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
1203 if (!new_back) 1201 if (!new_back)
1204 pr_info("No shadow/backing buffer allocated\n"); 1202 pr_info("No shadow/backing buffer allocated\n");
1205 else { 1203 else {
1206 if (dev->backing_buffer) 1204 vfree(dev->backing_buffer);
1207 vfree(dev->backing_buffer);
1208 dev->backing_buffer = new_back; 1205 dev->backing_buffer = new_back;
1209 } 1206 }
1210 } 1207 }