Skip to contentSkip to conversation

Patch "drm/amdgpu: set metadata pointer to NULL after freeing." has been added to the 4.5-stable tree

PATCH [email protected] 1 participant 1 message May 8, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

drm/amdgpu: set metadata pointer to NULL after freeing.

to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
drm-amdgpu-set-metadata-pointer-to-null-after-freeing.patch
and it can be found in the queue-4.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 0092d3edcb23fcdb8cbe4159ba94a534290ff982 Mon Sep 17 00:00:00 2001

From: Dave Airlie <[email protected]>
Date: Tue, 3 May 2016 12:44:29 +1000
Subject: drm/amdgpu: set metadata pointer to NULL after freeing.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Dave Airlie <[email protected]>

commit 0092d3edcb23fcdb8cbe4159ba94a534290ff982 upstream.

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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |    1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1 -0
@@ -540,6 +540,7 @@ int amdgpu_bo_set_metadata (struct amdgp
 	if (!metadata_size) {
 		if (bo->metadata_size) {
 			kfree(bo->metadata);
+			bo->metadata = NULL;
 			bo->metadata_size = 0;
 		}
 		return 0;

Patches currently in stable-queue which might be from [email protected] are

queue-4.5/gpu-ipu-v3-fix-imx-ipuv3-crtc-module-autoloading.patch queue-4.5/drm-amdgpu-set-metadata-pointer-to-null-after-freeing.patch