Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
drm/xe/xe_sync: initialise ufence.signalled
Browse files Browse the repository at this point in the history
commit 816b186 upstream.

We can incorrectly think that the fence has signalled, if we get a
non-zero value here from the kmalloc, which is quite plausible. Just use
kzalloc to prevent stuff like this.

Fixes: 977e5b8 ("drm/xe: Expose user fence from xe_sync_entry")
Signed-off-by: Matthew Auld <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: Nirmoy Das <[email protected]>
Cc: <[email protected]> # v6.10+
Reviewed-by: Nirmoy Das <[email protected]>
Reviewed-by: Matthew Brost <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 26f69e88dcc95fffc62ed2aea30ad7b1fdf31fdb)
Signed-off-by: Lucas De Marchi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
matt-auld authored and gregkh committed Oct 22, 2024
1 parent aeefacb commit 3afd7a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static struct xe_user_fence *user_fence_create(struct xe_device *xe, u64 addr,
if (!access_ok(ptr, sizeof(*ptr)))
return ERR_PTR(-EFAULT);

ufence = kmalloc(sizeof(*ufence), GFP_KERNEL);
ufence = kzalloc(sizeof(*ufence), GFP_KERNEL);
if (!ufence)
return ERR_PTR(-ENOMEM);

Expand Down

0 comments on commit 3afd7a2

Please sign in to comment.