All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: set metadata pointer to NULL after freeing.
@ 2016-05-03  2:44 Dave Airlie
  2016-05-03  7:06 ` Christian König
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Airlie @ 2016-05-03  2:44 UTC (permalink / raw)
  To: dri-devel

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>
---
 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;
-- 
2.5.5

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: set metadata pointer to NULL after freeing.
  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
  2016-05-03 15:54   ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2016-05-03  7:06 UTC (permalink / raw)
  To: Dave Airlie, dri-devel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: set metadata pointer to NULL after freeing.
  2016-05-03  7:06 ` Christian König
@ 2016-05-03 15:54   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2016-05-03 15:54 UTC (permalink / raw)
  To: Christian König; +Cc: Maling list - DRI developers

On Tue, May 3, 2016 at 3:06 AM, Christian König <deathsimple@vodafone.de> wrote:
> 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>


Applied!  thanks.

Alex

>
>> ---
>>   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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-03 15:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-05-03 15:54   ` Alex Deucher

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.