Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drm/xe/eustall: Fix a possible pointer dereference after free
@ 2025-03-12 17:31 Harish Chegondi
  2025-03-12 17:40 ` ✓ CI.Patch_applied: success for series starting with [1/1] " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Harish Chegondi @ 2025-03-12 17:31 UTC (permalink / raw)
  To: intel-xe; +Cc: ashutosh.dixit, james.ausmus, Harish Chegondi

If devm_add_action_or_reset() isn't successful, xe_eu_stall_fini()
is invoked. So, unsuccessful return from devm_add_action_or_reset()
shouldn't dereference gt->eu_stall as xe_eu_stall_fini() already
frees it. Fix this issue.

Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
---
 drivers/gpu/drm/xe/xe_eu_stall.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_eu_stall.c b/drivers/gpu/drm/xe/xe_eu_stall.c
index 88a92baf5c95..f2bb9168967c 100644
--- a/drivers/gpu/drm/xe/xe_eu_stall.c
+++ b/drivers/gpu/drm/xe/xe_eu_stall.c
@@ -222,13 +222,7 @@ int xe_eu_stall_init(struct xe_gt *gt)
 		goto exit_free;
 	}
 
-	ret = devm_add_action_or_reset(xe->drm.dev, xe_eu_stall_fini, gt);
-	if (ret)
-		goto exit_destroy;
-
-	return 0;
-exit_destroy:
-	destroy_workqueue(gt->eu_stall->buf_ptr_poll_wq);
+	return devm_add_action_or_reset(xe->drm.dev, xe_eu_stall_fini, gt);
 exit_free:
 	mutex_destroy(&gt->eu_stall->stream_lock);
 	kfree(gt->eu_stall);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-03-13  9:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-12 17:31 [PATCH 1/1] drm/xe/eustall: Fix a possible pointer dereference after free Harish Chegondi
2025-03-12 17:40 ` ✓ CI.Patch_applied: success for series starting with [1/1] " Patchwork
2025-03-12 17:40 ` ✓ CI.checkpatch: " Patchwork
2025-03-12 17:42 ` ✓ CI.KUnit: " Patchwork
2025-03-12 18:05 ` ✓ CI.Build: " Patchwork
2025-03-12 18:07 ` ✓ CI.Hooks: " Patchwork
2025-03-12 18:09 ` ✓ CI.checksparse: " Patchwork
2025-03-12 18:31 ` ✓ Xe.CI.BAT: " Patchwork
2025-03-12 22:09 ` [PATCH 1/1] " Dixit, Ashutosh
2025-03-13  9:25 ` ✓ Xe.CI.Full: success for series starting with [1/1] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox