Skip to content

Commit a2e1407

Browse files
mwajdeczrodrigovivi
authored andcommitted
drm/xe/guc: Clear whole g2h_fence during initialization
The struct g2h_fence must be explicitly initializated using the g2h_fence_init() function to avoid trash values in its members, but we missed to update this helper function with the new member. To fix that and avoid any future mistakes, memset the whole struct first, then update remaining non-zero members. Fixes: 94de94d ("drm/xe/guc: Cancel ongoing H2G requests when stopping CT") Signed-off-by: Michal Wajdeczko <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Lukasz Laguna <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit 159afd92bae8153bdd8d8b34aea0d463fe19c978) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent cccb918 commit a2e1407

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/gpu/drm/xe/xe_guc_ct.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,8 @@ struct g2h_fence {
9595

9696
static void g2h_fence_init(struct g2h_fence *g2h_fence, u32 *response_buffer)
9797
{
98+
memset(g2h_fence, 0, sizeof(*g2h_fence));
9899
g2h_fence->response_buffer = response_buffer;
99-
g2h_fence->response_data = 0;
100-
g2h_fence->response_len = 0;
101-
g2h_fence->fail = false;
102-
g2h_fence->retry = false;
103-
g2h_fence->done = false;
104100
g2h_fence->seqno = ~0x0;
105101
}
106102

0 commit comments

Comments
 (0)