All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: Dave Airlie <airlied@gmail.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: set metadata pointer to NULL after freeing.
Date: Tue, 3 May 2016 09:06:12 +0200	[thread overview]
Message-ID: <57284DE4.70702@vodafone.de> (raw)
In-Reply-To: <1462243469-2337-1-git-send-email-airlied@gmail.com>

Am 03.05.2016 um 04:44 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> Without this there was a double free of the metadata,
> which ended up freeing the fd table for me here, and taking
> out the machine more often than not.
>
> I reproduced with X.org + modesetting DDX + latest llvm/mesa,
> also required using dri3.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Dave Airlie <airlied@redhat.com>

Nice catch, patch is Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index e557fc1..7ecea83 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -541,6 +541,7 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,
>   	if (!metadata_size) {
>   		if (bo->metadata_size) {
>   			kfree(bo->metadata);
> +			bo->metadata = NULL;
>   			bo->metadata_size = 0;
>   		}
>   		return 0;

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-05-03  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03  2:44 [PATCH] drm/amdgpu: set metadata pointer to NULL after freeing Dave Airlie
2016-05-03  7:06 ` Christian König [this message]
2016-05-03 15:54   ` Alex Deucher

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=57284DE4.70702@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.