Skip to contentSkip to conversation

drm/amdkfd: fix a resource leakage issue

PATCH In review Dennis Li 2 participants 2 messages May 18, 2021

Subsystems (3)
lore
Share & tools
lore

Dennis Li

author
#0 lore raw

PATCH 1/1 drm/amdkfd: fix a resource leakage issue

The function kfd_lookup_process_by_pasid will increase the reference count of kfd_process object, its caller should call kfd_unref_process to decrease the reference count. Otherwise resource leakage will happen.

drivers/gpu/drm/amd/amdkfd/kfd_events.c +2 -0
index 3c9fe078334a..6cc6afb96a45 100644
@@ -1100,4 +1100,6 @@ void kfd_signal_poison_consumed_event(struct kfd_dev *dev, u32 pasid)
 
 	/* user application will handle SIGBUS signal */
 	send_sig(SIGBUS, p->lead_thread, 0);
+
+	kfd_unref_process(p);
 }
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only]

Regards,
Hawking
-----Original Message-----
From: Dennis Li <[email protected]>
Sent: Tuesday, May 18, 2021 19:59
To: [email protected]; Deucher, Alexander <[email protected]>; Kuehling, Felix <[email protected]>; Zhang, Hawking <[email protected]>; Koenig, Christian <[email protected]>
Cc: Li, Dennis <[email protected]>
Subject: [PATCH] drm/amdkfd: fix a resource leakage issue

The function kfd_lookup_process_by_pasid will increase the reference count of kfd_process object, its caller should call kfd_unref_process to decrease the reference count. Otherwise resource leakage will happen.

drivers/gpu/drm/amd/amdkfd/kfd_events.c +2 -0
index 3c9fe078334a..6cc6afb96a45 100644
@@ -1100,4 +1100,6 @@ void kfd_signal_poison_consumed_event(struct kfd_dev *dev, u32 pasid)
 
 	/* user application will handle SIGBUS signal */
 	send_sig(SIGBUS, p->lead_thread, 0);
+
+	kfd_unref_process(p);
 }

--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx