[PATCH] drm/xe: fix missing 'xe_vm_put'

Dafna Hirschfeld dhirschfeld at habana.ai
Sun Sep 1 04:42:27 UTC 2024


Fix memleak caused by missing xe_vm_put

Signed-off-by: Dafna Hirschfeld <dhirschfeld at habana.ai>
---
 drivers/gpu/drm/xe/xe_exec_queue.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
index fa4ed168b53b..df3ea337f55c 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.c
+++ b/drivers/gpu/drm/xe/xe_exec_queue.c
@@ -252,8 +252,10 @@ struct xe_exec_queue *xe_exec_queue_create_bind(struct xe_device *xe,
 							   gt->usm.reserved_bcs_instance,
 							   false);
 
-		if (!hwe)
+		if (!hwe) {
+			xe_vm_put(migrate_vm);
 			return ERR_PTR(-EINVAL);
+		}
 
 		q = xe_exec_queue_create(xe, migrate_vm,
 					 BIT(hwe->logical_instance), 1, hwe,
-- 
2.34.1



More information about the Intel-xe mailing list