[PATCH 1/2] drm/amdgpu: fix incorrect use of fcheck

Christian König ckoenig.leichtzumerken at gmail.com
Fri Aug 17 17:41:49 UTC 2018


The usage isn't RCU protected.

Signed-off-by: Christian König <christian.koenig at amd.com>
CC: stable at vger.kernel.org
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
index 86a0715d9431..cb62a90d0686 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
@@ -53,7 +53,7 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
 						  int fd,
 						  enum drm_sched_priority priority)
 {
-	struct file *filp = fcheck(fd);
+	struct file *filp = fget(fd);
 	struct drm_file *file;
 	struct pid *pid;
 	struct amdgpu_fpriv *fpriv;
@@ -78,6 +78,8 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
 
 	put_pid(pid);
 
+	fput(filp);
+
 	return 0;
 }
 
-- 
2.14.1



More information about the amd-gfx mailing list