Skip to content

Commit 46bcb0a

Browse files
ColinIanKingThomas Hellström
authored andcommitted
drm/xe/guc: Fix inverted logic on snapshot->copy check
Currently the check to see if snapshot->copy has been allocated is inverted and ends up dereferencing snapshot->copy when free'ing objects in the array when it is null or not free'ing the objects when snapshot->copy is allocated. Fix this by using the correct non-null pointer check logic. Fixes: d8ce1a9 ("drm/xe/guc: Use a two stage dump for GuC logs and add more info") Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: John Harrison <[email protected]> Signed-off-by: Thomas Hellström <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a187c1b commit 46bcb0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/xe/xe_guc_log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void xe_guc_log_snapshot_free(struct xe_guc_log_snapshot *snapshot)
122122
if (!snapshot)
123123
return;
124124

125-
if (!snapshot->copy) {
125+
if (snapshot->copy) {
126126
for (i = 0; i < snapshot->num_chunks; i++)
127127
kfree(snapshot->copy[i]);
128128
kfree(snapshot->copy);

0 commit comments

Comments
 (0)