projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67b7950
)
drm/xe: Fix ref counting leak on page fault
author
Matthew Brost
<matthew.brost@intel.com>
Fri, 1 Mar 2024 04:10:36 +0000
(20:10 -0800)
committer
Matthew Brost
<matthew.brost@intel.com>
Fri, 1 Mar 2024 17:36:01 +0000
(09:36 -0800)
If a page fault occurs on VM not in fault a ref can be leaked. Fix this.
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link:
https://patchwork.freedesktop.org/patch/msgid/20240301041036.238471-1-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_gt_pagefault.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/xe/xe_gt_pagefault.c
b/drivers/gpu/drm/xe/xe_gt_pagefault.c
index c26e4fcca01e6555a6b679e95f1e6d29e1b29afd..73c535193a984b385f65986c9b1c0d3b79f1f5b4 100644
(file)
--- a/
drivers/gpu/drm/xe/xe_gt_pagefault.c
+++ b/
drivers/gpu/drm/xe/xe_gt_pagefault.c
@@
-146,10
+146,12
@@
static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
/* ASID to VM */
mutex_lock(&xe->usm.lock);
vm = xa_load(&xe->usm.asid_to_vm, pf->asid);
- if (vm)
+ if (vm
&& xe_vm_in_fault_mode(vm)
)
xe_vm_get(vm);
+ else
+ vm = NULL;
mutex_unlock(&xe->usm.lock);
- if (!vm
|| !xe_vm_in_fault_mode(vm)
)
+ if (!vm)
return -EINVAL;
retry_userptr: