mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Lucas Stach <dev@lynxeye.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/7] video: displaytimings: don't double free display timings
Date: Thu, 7 Jul 2016 08:52:22 +0200	[thread overview]
Message-ID: <20160707065222.GW20657@pengutronix.de> (raw)
In-Reply-To: <1467830680-5909-3-git-send-email-dev@lynxeye.de>

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@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);

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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-07-07  6:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 18:44 [PATCH 1/7] compiler: avoid redefining symbols when running with checker Lucas Stach
2016-07-06 18:44 ` [PATCH 2/7] USB: gadget: composite: avoid possible NULL ptr dereference Lucas Stach
2016-07-06 18:44 ` [PATCH 3/7] video: displaytimings: don't double free display timings Lucas Stach
2016-07-07  6:52   ` Sascha Hauer [this message]
2016-07-06 18:44 ` [PATCH 4/7] imx-bbu-nand-fcb: don't drop error return code Lucas Stach
2016-07-06 18:44 ` [PATCH 5/7] imx-bbu-nand-fcb: avoid double free of dbbt_entries Lucas Stach
2016-07-06 18:44 ` [PATCH 6/7] clk: fix misleading indenting Lucas Stach
2016-07-06 18:44 ` [PATCH 7/7] blspec: use correct return type Lucas Stach
2016-07-07  7:43   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160707065222.GW20657@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=dev@lynxeye.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox