Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/xe_sync: initialise ufence.signalled
@ 2024-10-11 13:36 Matthew Auld
  2024-10-11 13:43 ` Nirmoy Das
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Matthew Auld @ 2024-10-11 13:36 UTC (permalink / raw)
  To: intel-xe; +Cc: Mika Kuoppala, Matthew Brost, Nirmoy Das, stable

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: 977e5b82e090 ("drm/xe: Expose user fence from xe_sync_entry")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Cc: <stable@vger.kernel.org> # v6.10+
---
 drivers/gpu/drm/xe/xe_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c
index bb3c2a830362..c6cf227ead40 100644
--- a/drivers/gpu/drm/xe/xe_sync.c
+++ b/drivers/gpu/drm/xe/xe_sync.c
@@ -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);
 
-- 
2.46.2


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

end of thread, other threads:[~2024-10-12  2:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 13:36 [PATCH] drm/xe/xe_sync: initialise ufence.signalled Matthew Auld
2024-10-11 13:43 ` Nirmoy Das
2024-10-11 14:45 ` ✓ CI.Patch_applied: success for " Patchwork
2024-10-11 14:45 ` ✓ CI.checkpatch: " Patchwork
2024-10-11 14:46 ` ✓ CI.KUnit: " Patchwork
2024-10-11 14:58 ` ✓ CI.Build: " Patchwork
2024-10-11 15:00 ` ✓ CI.Hooks: " Patchwork
2024-10-11 15:02 ` ✓ CI.checksparse: " Patchwork
2024-10-11 15:30 ` ✓ CI.BAT: " Patchwork
2024-10-11 18:37 ` ✗ CI.FULL: failure " Patchwork
2024-10-12  2:08 ` [PATCH] " Matthew Brost

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