linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] video: Fix possible leak in of_get_videomode()
Date: Mon, 10 Aug 2015 09:53:59 +0000	[thread overview]
Message-ID: <55C874B7.4090704@ti.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]



On 11/07/15 20:46, Christian Engelmayer wrote:
> In case videomode_from_timings() fails in function of_get_videomode(), the
> allocated display timing data is not freed in the exit path. Make sure that
> display_timings_release() is called in any case. Detected by Coverity CID
> 1309681.
> 
> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
> ---
> Compile tested only. Applies against linux-next.
> ---
>  drivers/video/of_videomode.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/video/of_videomode.c b/drivers/video/of_videomode.c
> index 111c2d1911d3..3495b48c6805 100644
> --- a/drivers/video/of_videomode.c
> +++ b/drivers/video/of_videomode.c
> @@ -44,11 +44,7 @@ int of_get_videomode(struct device_node *np, struct videomode *vm,
>  		index = disp->native_mode;
>  
>  	ret = videomode_from_timings(disp, vm, index);
> -	if (ret)
> -		return ret;
> -
>  	display_timings_release(disp);
> -
> -	return 0;
> +	return ret;
>  }
>  EXPORT_SYMBOL_GPL(of_get_videomode);
> 

Thanks, queued for 4.2.

 Tomi


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

             reply	other threads:[~2015-08-10  9:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-10  9:53 Tomi Valkeinen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-11 17:46 [PATCH] video: Fix possible leak in of_get_videomode() Christian Engelmayer

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=55C874B7.4090704@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).