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

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

 



On Wed, Jul 06, 2016 at 08:44:36PM +0200, Lucas Stach wrote:
> 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);

Can't we just always use display_timings_release() instead of free?

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
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