All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Return NULL on error in active_instance
@ 2026-06-24  9:09 Joonas Lahtinen
  2026-06-24  9:20 ` Sebastian Brzezinka
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Joonas Lahtinen @ 2026-06-24  9:09 UTC (permalink / raw)
  To: Intel graphics driver community testing & development
  Cc: Joonas Lahtinen, Martin Hodo, Maarten Lankhorst,
	Thomas Hellström, Simona Vetter, stable

Avoid returning &node->base when node is NULL due to OOM
during GFP_ATOMIC allocation.

Discovered using AI-assisted static analysis confirmed by
Intel Product Security.

Reported-by: Martin Hodo <martin.hodo@intel.com>
Fixes: bfaae47db3c0 ("drm/i915: make lockdep slightly happier about execbuf.")
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Simona Vetter <simona.vetter@ffwll.ch>
Cc: <stable@vger.kernel.org> # v5.13+
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_active.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c
index 5cb7a72774a0..aa77def0bc0d 100644
--- a/drivers/gpu/drm/i915/i915_active.c
+++ b/drivers/gpu/drm/i915/i915_active.c
@@ -318,7 +318,7 @@ active_instance(struct i915_active *ref, u64 idx)
 	 */
 	node = kmem_cache_alloc(slab_cache, GFP_ATOMIC);
 	if (!node)
-		goto out;
+		goto err;
 
 	__i915_active_fence_init(&node->base, NULL, node_retire);
 	node->ref = ref;
@@ -332,6 +332,11 @@ active_instance(struct i915_active *ref, u64 idx)
 	spin_unlock_irq(&ref->tree_lock);
 
 	return &node->base;
+
+err:
+	spin_unlock_irq(&ref->tree_lock);
+
+	return NULL;
 }
 
 void __i915_active_init(struct i915_active *ref,
-- 
2.54.0


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

end of thread, other threads:[~2026-06-24 12:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24  9:09 [PATCH] drm/i915: Return NULL on error in active_instance Joonas Lahtinen
2026-06-24  9:20 ` Sebastian Brzezinka
2026-06-24  9:27 ` Sebastian Brzezinka
2026-06-24 10:24   ` Joonas Lahtinen
2026-06-24 10:29     ` Sebastian Brzezinka
2026-06-24  9:54 ` Maarten Lankhorst
2026-06-24 10:36 ` ✗ i915.CI.BAT: failure for " Patchwork
2026-06-24 11:24   ` Joonas Lahtinen
2026-06-24 11:25 ` [PATCH] " Joonas Lahtinen
2026-06-24 12:59   ` Andi Shyti

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.