* [PATCH] video:fbdev:core:Calculate the size for colormap only after the validation of length for col
@ 2015-10-30 11:48 Shailendra Verma
0 siblings, 0 replies; 2+ messages in thread
From: Shailendra Verma @ 2015-10-30 11:48 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev
Cc: linux-kernel, vidushi.koul
From: Shailendra Verma <shailendra.v@samsung.com>
While allocating the memory for color map, the memory size for colors
is being calculated before the validation of length for color map.
Moved the size calculation part after the validation of color map length.
Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
---
drivers/video/fbdev/core/fbcmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/core/fbcmap.c b/drivers/video/fbdev/core/fbcmap.c
index f89245b..45ad567 100644
--- a/drivers/video/fbdev/core/fbcmap.c
+++ b/drivers/video/fbdev/core/fbcmap.c
@@ -91,7 +91,7 @@ static const struct fb_cmap default_16_colors = {
int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags)
{
- int size = len * sizeof(u16);
+ int size;
int ret = -ENOMEM;
if (cmap->len != len) {
@@ -99,6 +99,7 @@ int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags)
if (!len)
return 0;
+ size = len * sizeof(u16);
cmap->red = kmalloc(size, flags);
if (!cmap->red)
goto fail;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] video:fbdev:core:Calculate the size for colormap only after the validation of length for col
@ 2015-11-09 8:18 Shailendra Verma
0 siblings, 0 replies; 2+ messages in thread
From: Shailendra Verma @ 2015-11-09 8:18 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev,
Greg Kroah-Hartman
Cc: linux-kernel, vidushi.koul, shailendra.v
From: Shailendra Verma <shailendra.v@samsung.com>
While allocating the memory for color map, the memory size for colors
is being calculated before the validation of length for color map.
Moved the size calculation part after the validation of color map length.
Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
---
drivers/video/fbdev/core/fbcmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/core/fbcmap.c b/drivers/video/fbdev/core/fbcmap.c
index f89245b..45ad567 100644
--- a/drivers/video/fbdev/core/fbcmap.c
+++ b/drivers/video/fbdev/core/fbcmap.c
@@ -91,7 +91,7 @@ static const struct fb_cmap default_16_colors = {
int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags)
{
- int size = len * sizeof(u16);
+ int size;
int ret = -ENOMEM;
if (cmap->len != len) {
@@ -99,6 +99,7 @@ int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags)
if (!len)
return 0;
+ size = len * sizeof(u16);
cmap->red = kmalloc(size, flags);
if (!cmap->red)
goto fail;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-09 8:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-09 8:18 [PATCH] video:fbdev:core:Calculate the size for colormap only after the validation of length for col Shailendra Verma
-- strict thread matches above, loose matches on Subject: below --
2015-10-30 11:48 Shailendra Verma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).