]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/amd/amdgpu: validate the shadow BO.
authorAlex Xie <AlexBin.Xie@amd.com>
Wed, 30 Nov 2016 22:19:40 +0000 (17:19 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Dec 2016 23:08:32 +0000 (18:08 -0500)
Fixes a rare NULL pointer dereference in amdgpu_ttm_bind.

The issue was found by Nicolai Haehnle.
The patch was tested by Nicolai Haehnle.

Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

index 5a277495d6a31606592cabc4caa996d5b39775eb..29d6d84d1c28b1e847715c08b6fac8f9d2a9aac3 100644 (file)
@@ -451,7 +451,7 @@ static int amdgpu_cs_validate(void *param, struct amdgpu_bo *bo)
                return r;
 
        if (bo->shadow)
-               r = amdgpu_cs_bo_validate(p, bo);
+               r = amdgpu_cs_bo_validate(p, bo->shadow);
 
        return r;
 }