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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux