]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
drm/amdgpu: set metadata pointer to NULL after freeing.
authorDave Airlie <airlied@redhat.com>
Tue, 3 May 2016 02:44:29 +0000 (12:44 +1000)
committerKamal Mostafa <kamal@canonical.com>
Mon, 16 May 2016 17:28:24 +0000 (10:28 -0700)
BugLink: http://bugs.launchpad.net/bugs/1580754
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.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index b8fbbd7699e4586e13e57905b0cef818f6e43e6b..73628c7599e748a3bb2ebe72d25133927e97f315 100644 (file)
@@ -540,6 +540,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;