[PATCH v5 2/9] drm/xe: Clear all snapshot members after deleting coredump
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Wed Feb 21 13:30:17 UTC 2024
It's not strictly needed to clear right now, but this prevents bugs
from dangling pointers.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
drivers/gpu/drm/xe/xe_devcoredump.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_devcoredump.c
index 08d3f6cb72292..ae26d8c6d01c5 100644
--- a/drivers/gpu/drm/xe/xe_devcoredump.c
+++ b/drivers/gpu/drm/xe/xe_devcoredump.c
@@ -124,6 +124,8 @@ static void xe_devcoredump_free(void *data)
if (coredump->snapshot.hwe[i])
xe_hw_engine_snapshot_free(coredump->snapshot.hwe[i]);
+ /* To prevent stale data on next snapshot, clear everything */
+ memset(&coredump->snapshot, 0, sizeof(coredump->snapshot));
coredump->captured = false;
drm_info(&coredump_to_xe(coredump)->drm,
"Xe device coredump has been deleted.\n");
--
2.43.0
More information about the Intel-xe
mailing list