diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2014-11-23 11:40:47 +0100 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-12-04 16:16:01 +0200 |
commit | 177c0386ea5beb5b8c73d7dbde41487f3f4eabf4 (patch) | |
tree | 2cc78de059adb95159465667a7cc2346ddaf079f /drivers/video | |
parent | e87d9f295a7f3e9e7aae7a64f8fa9b45ceb1bf1c (diff) | |
download | op-kernel-dev-177c0386ea5beb5b8c73d7dbde41487f3f4eabf4.zip op-kernel-dev-177c0386ea5beb5b8c73d7dbde41487f3f4eabf4.tar.gz |
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>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/udlfb.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index 046d51d..ff2b873 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -922,8 +922,7 @@ static void dlfb_free(struct kref *kref) { struct dlfb_data *dev = container_of(kref, struct dlfb_data, kref); - if (dev->backing_buffer) - vfree(dev->backing_buffer); + vfree(dev->backing_buffer); kfree(dev->edid); @@ -953,8 +952,7 @@ static void dlfb_free_framebuffer(struct dlfb_data *dev) fb_dealloc_cmap(&info->cmap); if (info->monspecs.modedb) fb_destroy_modedb(info->monspecs.modedb); - if (info->screen_base) - vfree(info->screen_base); + vfree(info->screen_base); fb_destroy_modelist(&info->modelist); @@ -1203,8 +1201,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) if (!new_back) pr_info("No shadow/backing buffer allocated\n"); else { - if (dev->backing_buffer) - vfree(dev->backing_buffer); + vfree(dev->backing_buffer); dev->backing_buffer = new_back; } } |