summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthik Bhat <kv.bhat@samsung.com>2018-08-31 14:28:21 +0530
committerKarthik Bhat <kv.bhat@samsung.com>2018-08-31 14:28:21 +0530
commitd3411ebdf5faa5d5d5d45fbcbd81a339b0c00692 (patch)
tree71a0ab8f07f61aa0b1f2d66bd8c90c00484c766a
parentbf6fd5c85eb1f75577bcf91f55fe03a540269044 (diff)
downloademulator-kernel-d3411ebdf5faa5d5d5d45fbcbd81a339b0c00692.tar.gz
emulator-kernel-d3411ebdf5faa5d5d5d45fbcbd81a339b0c00692.tar.bz2
emulator-kernel-d3411ebdf5faa5d5d5d45fbcbd81a339b0c00692.zip
Fix SVACE Issues
Change-Id: I5acfbfef1a97a7785523b848fd7a5c3678a3261f Signed-off-by: Karthik Bhat <kv.bhat@samsung.com>
-rw-r--r--drivers/gpu/drm/drm_crtc.c7
-rw-r--r--drivers/gpu/drm/vigs/vigs_fbdev.c4
-rw-r--r--drivers/gpu/drm/vigs/vigs_mman.c2
-rw-r--r--drivers/gpu/drm/vigs/vigs_output.c2
-rw-r--r--drivers/video/fbdev/core/fb_cmdline.c1
5 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 6f65f06c37a0..64da7747f4e3 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -819,12 +819,12 @@ static void drm_connector_get_cmdline_mode(struct drm_connector *connector)
char *option = NULL;
if (fb_get_options(connector->name, &option))
- return;
+ goto out_err;
if (!drm_mode_parse_command_line_for_connector(option,
connector,
mode))
- return;
+ goto out_err;
if (mode->force) {
const char *s;
@@ -853,6 +853,9 @@ static void drm_connector_get_cmdline_mode(struct drm_connector *connector)
mode->rb ? " reduced blanking" : "",
mode->margins ? " with margins" : "",
mode->interlace ? " interlaced" : "");
+ out_err:
+ if(option != NULL)
+ kfree(option);
}
/**
diff --git a/drivers/gpu/drm/vigs/vigs_fbdev.c b/drivers/gpu/drm/vigs/vigs_fbdev.c
index 2f7803f7aeb9..69ec82f90986 100644
--- a/drivers/gpu/drm/vigs/vigs_fbdev.c
+++ b/drivers/gpu/drm/vigs/vigs_fbdev.c
@@ -403,7 +403,7 @@ static int vigs_fbdev_probe_once(struct drm_fb_helper *helper,
goto fail4;
}
- strcpy(fbi->fix.id, "VIGS");
+ strncpy(fbi->fix.id, "VIGS", sizeof(fbi->fix.id));
drm_fb_helper_fill_fix(fbi, vigs_fb->base.pitches[0], vigs_fb->base.depth);
drm_fb_helper_fill_var(fbi, helper, vigs_fb->base.width, vigs_fb->base.height);
@@ -434,7 +434,7 @@ static int vigs_fbdev_probe_once(struct drm_fb_helper *helper,
* TODO: Play around with xoffset/yoffset, make sure this code works.
*/
- offset = fbi->var.xoffset * (vigs_fb->base.bits_per_pixel >> 3);
+ offset = (unsigned long)(fbi->var.xoffset) * (vigs_fb->base.bits_per_pixel >> 3);
offset += fbi->var.yoffset * vigs_fb->base.pitches[0];
/*
diff --git a/drivers/gpu/drm/vigs/vigs_mman.c b/drivers/gpu/drm/vigs/vigs_mman.c
index 9440d44c40fb..38316c7b7c8b 100644
--- a/drivers/gpu/drm/vigs/vigs_mman.c
+++ b/drivers/gpu/drm/vigs/vigs_mman.c
@@ -440,7 +440,7 @@ int vigs_mman_create(resource_size_t vram_base,
goto fail1;
}
- sprintf(vma_cache_name, "vigs_vma_cache%u", vigs_vma_cache_index++);
+ snprintf(vma_cache_name, 100, "vigs_vma_cache%u", vigs_vma_cache_index++);
(*mman)->vma_cache = kmem_cache_create(vma_cache_name,
sizeof(struct vigs_mman_vma) +
diff --git a/drivers/gpu/drm/vigs/vigs_output.c b/drivers/gpu/drm/vigs/vigs_output.c
index b192208a1cfd..47603cbbdd8c 100644
--- a/drivers/gpu/drm/vigs/vigs_output.c
+++ b/drivers/gpu/drm/vigs/vigs_output.c
@@ -112,6 +112,8 @@ static int vigs_connector_get_modes(struct drm_connector *connector)
preferred_mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
drm_mode_set_crtcinfo(preferred_mode, CRTC_INTERLACE_HALVE_V);
drm_mode_probed_add(connector, preferred_mode);
+ if (option != NULL)
+ kfree(option);
return 1;
}
}
diff --git a/drivers/video/fbdev/core/fb_cmdline.c b/drivers/video/fbdev/core/fb_cmdline.c
index 39509ccd92f1..32ad2f343fa6 100644
--- a/drivers/video/fbdev/core/fb_cmdline.c
+++ b/drivers/video/fbdev/core/fb_cmdline.c
@@ -52,6 +52,7 @@ int fb_get_options(const char *name, char **option)
opt[name_len] == ':')
options = opt + name_len + 1;
}
+ options = kstrdup(options, GFP_KERNEL);
}
/* No match, pass global option */
if (!options && option && fb_mode_option)