[PATCH] video: of: fix memory leak

Subsystems: framebuffer layer, the rest

STALE3989d

2 messages, 2 authors, 2015-10-07 · open the first message on its own page

[PATCH] video: of: fix memory leak

From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date: 2015-09-30 10:06:40

If of_parse_display_timing() fails we are printing an error message and
jumping to the error path but we missed freeing "dt".

Signed-off-by: Sudip Mukherjee <redacted>
---
 drivers/video/of_display_timing.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index 32d8275..8a1076b 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -210,6 +210,7 @@ struct display_timings *of_get_display_timings(struct device_node *np)
 			 */
 			pr_err("%s: error in timing %d\n",
 				of_node_full_name(np), disp->num_timings + 1);
+			kfree(dt);
 			goto timingfail;
 		}
 
-- 
1.9.1

Re: [PATCH] video: of: fix memory leak

From: Tomi Valkeinen <hidden>
Date: 2015-10-07 11:14:27

On 30/09/15 12:54, Sudip Mukherjee wrote:
quoted hunk
If of_parse_display_timing() fails we are printing an error message and
jumping to the error path but we missed freeing "dt".

Signed-off-by: Sudip Mukherjee <redacted>
---
 drivers/video/of_display_timing.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index 32d8275..8a1076b 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -210,6 +210,7 @@ struct display_timings *of_get_display_timings(struct device_node *np)
 			 */
 			pr_err("%s: error in timing %d\n",
 				of_node_full_name(np), disp->num_timings + 1);
+			kfree(dt);
 			goto timingfail;
 		}
Thanks, queued for 4.3 fixes.

 Tomi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help