[PATCH 3/7] video: displaytimings: don't double free display timings

Lucas Stach dev at lynxeye.de
Wed Jul 6 11:44:36 PDT 2016


display_timings_release() already frees the disp struct, make sure
to not try to free it again in case of an error.

Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 drivers/video/of_display_timing.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index 6a5bf62..6532dd5 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -163,7 +163,8 @@ struct display_timings *of_get_display_timings(struct device_node *np)
 			 */
 			pr_err("%s: error in timing %d\n",
 				np->full_name, disp->num_modes + 1);
-			goto timingfail;
+			display_timings_release(disp);
+			return NULL;
 		}
 
 		mode->name = xstrdup(entry->name);
@@ -180,8 +181,6 @@ struct display_timings *of_get_display_timings(struct device_node *np)
 
 	return disp;
 
-timingfail:
-	display_timings_release(disp);
 entryfail:
 	free(disp);
 
-- 
2.7.4




More information about the barebox mailing list