dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: abhinavk@codeaurora.org
To: Roy Spliet <nouveau@spliet.org>
Cc: robdclark@chromium.org, freedreno@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [Freedreno] [PATCH] drm/msm/mdp5: Fix mdp5_init error path for failed mdp5_kms allocation
Date: Tue, 07 Apr 2020 10:45:45 -0700	[thread overview]
Message-ID: <2a5886971b510576343c7f4d9fb5cfe6@codeaurora.org> (raw)
In-Reply-To: <20200407170737.66651-1-nouveau@spliet.org>

On 2020-04-07 10:07, Roy Spliet wrote:
> When allocation for mdp5_kms fails, calling mdp5_destroy() leads to 
> undefined
> behaviour, likely a nullptr exception or use-after-free troubles.
> 
> Signed-off-by: Roy Spliet <nouveau@spliet.org>
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> index 6650f478b226..02c2c7d48bae 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> @@ -943,7 +943,8 @@ static int mdp5_init(struct platform_device *pdev,
> struct drm_device *dev)
> 
>  	return 0;
>  fail:
> -	mdp5_destroy(pdev);
> +	if (mdp5_kms)
> +		mdp5_destroy(pdev);
>  	return ret;
>  }
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2020-04-07 17:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 17:07 [PATCH] drm/msm/mdp5: Fix mdp5_init error path for failed mdp5_kms allocation Roy Spliet
2020-04-07 17:45 ` abhinavk [this message]

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=2a5886971b510576343c7f4d9fb5cfe6@codeaurora.org \
    --to=abhinavk@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=nouveau@spliet.org \
    --cc=robdclark@chromium.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