aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0819-drm-amdgpu-Passing-verification-of-NULL-filep-to-sup.patch
blob: a6ab8f12bcfe853b8793c8b2573752833664bb6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 24898ee3dcfc2ad54b24383b1c5ca5a8a92dd451 Mon Sep 17 00:00:00 2001
From: Ben Goz <ben.goz@amd.com>
Date: Sun, 16 Aug 2015 16:07:57 +0300
Subject: [PATCH 0819/4131] drm/amdgpu: Passing verification of NULL filep to
 support mmap_bo

Signed-off-by: Ben Goz <ben.goz@amd.com>

 Conflicts:
	drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

Change-Id: I162d7efd3e4bca393f690c4705f59bfbd46c3489
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 1c76f9e..9eac161 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -277,6 +277,8 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
 static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp)
 {
 	struct amdgpu_bo *abo = container_of(bo, struct amdgpu_bo, tbo);
+	if (filp == NULL)
+		return 0;
 
 	if (amdgpu_ttm_tt_get_usermm(bo->ttm))
 		return -EPERM;
-- 
2.7.4