Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	"Intel graphics driver community testing & development"
	<intel-gfx@lists.freedesktop.org>
Cc: "Martin Hodo" <martin.hodo@intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Simona Vetter" <simona.vetter@ffwll.ch>,
	stable@vger.kernel.org
Subject: Re: [PATCH] drm/i915: Return NULL on error in active_instance
Date: Wed, 24 Jun 2026 11:27:07 +0200	[thread overview]
Message-ID: <DJH67X9IJD3J.1YRKHO7I0JSZF@intel.com> (raw)
In-Reply-To: <20260624090940.74840-1-joonas.lahtinen@linux.intel.com>

Hi,
On Wed Jun 24, 2026 at 11:09 AM CEST, Joonas Lahtinen wrote:
> 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;
just a nit: this jump is not neccesery, you could return early.

-- 
Best regards,
Sebastian


  parent reply	other threads:[~2026-06-24  9:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-06-24 10:24   ` Joonas Lahtinen
2026-06-24 10:29     ` Sebastian Brzezinka
2026-06-24  9:54 ` Maarten Lankhorst
2026-06-24 11:25 ` Joonas Lahtinen
2026-06-24 12:59   ` Andi Shyti
2026-06-25  6:03     ` Joonas Lahtinen
2026-06-25  8:50       ` [PATCH] drm/i915: Return NULL on error in active_instanceg Andi Shyti
2026-06-25 12:11         ` Joonas Lahtinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DJH67X9IJD3J.1YRKHO7I0JSZF@intel.com \
    --to=sebastian.brzezinka@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=martin.hodo@intel.com \
    --cc=simona.vetter@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox