linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video:fbdev:core:Allocate the memory for video mode after the validation of edid.
@ 2015-10-30 11:49 Shailendra Verma
  2015-11-09  8:15 ` Shailendra Verma
  2015-11-09  8:16 ` Shailendra Verma
  0 siblings, 2 replies; 3+ messages in thread
From: Shailendra Verma @ 2015-10-30 11:49 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev
  Cc: linux-kernel, vidushi.koul

From: Shailendra Verma <shailendra.v@samsung.com>

In this function "fb_create_modedb" the memory for video mode is getting
allocated before the edid validation.If the validation of edid fails
then we are freeing the allocated memory for the video mode and returning.
So moving the memory allocation part after the edid validation.There is no
need to allocate the memory before edid validation check and freeing if
validation gets failed.

Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
---
 drivers/video/fbdev/core/fbmon.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 47c3191..476a5fd 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -620,16 +620,16 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize,
 	int num = 0, i, first = 1;
 	int ver, rev;
 
-	mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
-	if (mode = NULL)
-		return NULL;
-
 	if (edid = NULL || !edid_checksum(edid) ||
 	    !edid_check_header(edid)) {
-		kfree(mode);
 		return NULL;
 	}
 
+	mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
+	if (mode = NULL)
+		return NULL;
+
+
 	ver = edid[EDID_STRUCT_VERSION];
 	rev = edid[EDID_STRUCT_REVISION];
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] video:fbdev:core:Allocate the memory for video mode after the validation of edid.
  2015-10-30 11:49 [PATCH] video:fbdev:core:Allocate the memory for video mode after the validation of edid Shailendra Verma
@ 2015-11-09  8:15 ` Shailendra Verma
  2015-11-09  8:16 ` Shailendra Verma
  1 sibling, 0 replies; 3+ messages in thread
From: Shailendra Verma @ 2015-11-09  8:15 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev,
	Greg Kroah-Hartman
  Cc: linux-kernel, vidushi.koul

From: Shailendra Verma <shailendra.v@samsung.com>

In this function "fb_create_modedb" the memory for video mode is getting
allocated before the edid validation.If the validation of edid fails
then we are freeing the allocated memory for the video mode and returning.
So moving the memory allocation part after the edid validation.There is no
need to allocate the memory before edid validation check and freeing if
validation gets failed.

Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
---
 drivers/video/fbdev/core/fbmon.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 47c3191..476a5fd 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -620,16 +620,16 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize,
 	int num = 0, i, first = 1;
 	int ver, rev;
 
-	mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
-	if (mode = NULL)
-		return NULL;
-
 	if (edid = NULL || !edid_checksum(edid) ||
 	    !edid_check_header(edid)) {
-		kfree(mode);
 		return NULL;
 	}
 
+	mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
+	if (mode = NULL)
+		return NULL;
+
+
 	ver = edid[EDID_STRUCT_VERSION];
 	rev = edid[EDID_STRUCT_REVISION];
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] video:fbdev:core:Allocate the memory for video mode after the validation of edid.
  2015-10-30 11:49 [PATCH] video:fbdev:core:Allocate the memory for video mode after the validation of edid Shailendra Verma
  2015-11-09  8:15 ` Shailendra Verma
@ 2015-11-09  8:16 ` Shailendra Verma
  1 sibling, 0 replies; 3+ messages in thread
From: Shailendra Verma @ 2015-11-09  8:16 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>

In this function "fb_create_modedb" the memory for video mode is getting
allocated before the edid validation.If the validation of edid fails
then we are freeing the allocated memory for the video mode and returning.
So moving the memory allocation part after the edid validation.There is no
need to allocate the memory before edid validation check and freeing if
validation gets failed.

Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
---
 drivers/video/fbdev/core/fbmon.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 47c3191..476a5fd 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -620,16 +620,16 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize,
 	int num = 0, i, first = 1;
 	int ver, rev;
 
-	mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
-	if (mode = NULL)
-		return NULL;
-
 	if (edid = NULL || !edid_checksum(edid) ||
 	    !edid_check_header(edid)) {
-		kfree(mode);
 		return NULL;
 	}
 
+	mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
+	if (mode = NULL)
+		return NULL;
+
+
 	ver = edid[EDID_STRUCT_VERSION];
 	rev = edid[EDID_STRUCT_REVISION];
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-09  8:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-30 11:49 [PATCH] video:fbdev:core:Allocate the memory for video mode after the validation of edid Shailendra Verma
2015-11-09  8:15 ` Shailendra Verma
2015-11-09  8:16 ` 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).