projects/linux·commit d663baba

video: of: fix memory leak

d663baba · Sudip Mukherjee <[email protected]> · 2015-09-30 15:24:08 +05:30

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 <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Commit
d663baba8b16f3097ac3fb5baf97c54970d2f1ff
Parents
4d370b74

Changes

1 files changed · +1 −0

FileStatusAddDelContent
drivers/video/of_display_timing.cmodified+1−0View file

drivers/video/of_display_timing.c

View file
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;
}