All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Badal Nilawar <badal.nilawar@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: <anshuman.gupta@intel.com>, <rodrigo.vivi@intel.com>,
	<alexander.usyskin@intel.com>, <michael.j.ruhl@intel.com>,
	<anoop.c.vijay@intel.com>, <shamim.begum@intel.com>,
	<anthony.giardina@intel.com>
Subject: Re: [PATCH v4 1/5] drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry
Date: Mon, 3 Aug 2026 15:31:45 -0700	[thread overview]
Message-ID: <ebb9bad7-9df6-41bf-af7d-9275384169e5@intel.com> (raw)
In-Reply-To: <20260723083659.716683-8-badal.nilawar@intel.com>



On 7/23/2026 1:37 AM, Badal Nilawar wrote:
> Release firmware when the "LTES" manifest entry is not found in the
> firmware header.
>
> Fixes: efa29317a553 ("drm/xe/xe_late_bind_fw: Extract and print version info")
> Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_late_bind_fw.c | 14 ++++++++------
>   1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_late_bind_fw.c b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> index 768442ca7da6..1529a1de4051 100644
> --- a/drivers/gpu/drm/xe/xe_late_bind_fw.c
> +++ b/drivers/gpu/drm/xe/xe_late_bind_fw.c
> @@ -335,19 +335,19 @@ static int __xe_late_bind_fw_init(struct xe_late_bind *late_bind, u32 fw_id)
>   	if (fw->size > XE_LB_MAX_PAYLOAD_SIZE) {
>   		drm_err(&xe->drm, "Firmware %s size %zu is larger than max pay load size %u\n",
>   			lb_fw->blob_path, fw->size, XE_LB_MAX_PAYLOAD_SIZE);
> -		release_firmware(fw);
> -		return -ENODATA;
> +		ret = -ENODATA;
> +		goto release_fw;
>   	}
>   
>   	ret = parse_lb_layout(lb_fw, fw->data, fw->size, "LTES");
>   	if (ret)
> -		return ret;
> +		goto release_fw;
>   
>   	lb_fw->payload_size = fw->size;
>   	lb_fw->payload = drmm_kzalloc(&xe->drm, lb_fw->payload_size, GFP_KERNEL);
>   	if (!lb_fw->payload) {
> -		release_firmware(fw);
> -		return -ENOMEM;
> +		ret = -ENOMEM;
> +		goto release_fw;
>   	}
>   
>   	drm_info(&xe->drm, "Using %s firmware from %s version %u.%u.%u.%u\n",
> @@ -359,7 +359,9 @@ static int __xe_late_bind_fw_init(struct xe_late_bind *late_bind, u32 fw_id)
>   	release_firmware(fw);
>   	INIT_WORK(&lb_fw->work, xe_late_bind_work);
>   
> -	return 0;
> +release_fw:
> +	release_firmware(fw);

shouldn't the release_firmware a few lines above be dropped? Otherwise 
you're calling it twice in the successful case.

Daniele

> +	return ret;
>   }
>   
>   static int xe_late_bind_fw_init(struct xe_late_bind *late_bind)


  reply	other threads:[~2026-08-03 22:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  8:37 [PATCH v4 0/5] Add ocode late binding support for CRI Badal Nilawar
2026-07-23  8:33 ` ✗ CI.checkpatch: warning for Add ocode late binding support for CRI (rev4) Patchwork
2026-07-23  8:35 ` ✓ CI.KUnit: success " Patchwork
2026-07-23  8:37 ` [PATCH v4 1/5] drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry Badal Nilawar
2026-08-03 22:31   ` Daniele Ceraolo Spurio [this message]
2026-07-23  8:37 ` [PATCH v4 2/5] drm/xe/xe_late_bind_fw: Convert late bind flag to mask Badal Nilawar
2026-08-03 22:34   ` Daniele Ceraolo Spurio
2026-07-23  8:37 ` [PATCH v4 3/5] drm/xe/xe_late_bind_fw: Add support to load Ocode firmware Badal Nilawar
2026-07-23  8:37 ` [PATCH v4 4/5] drm/xe/xe_late_bind_fw: Enable late binding support for CRI Badal Nilawar
2026-07-23  8:37 ` [PATCH v4 5/5] drm/xe/xe_late_bind_fw: Refactor pm flow Badal Nilawar
2026-07-23  9:19 ` ✓ Xe.CI.BAT: success for Add ocode late binding support for CRI (rev4) Patchwork
2026-07-23 16:46 ` [PATCH v4 0/5] Add ocode late binding support for CRI Rodrigo Vivi
2026-07-24  6:37 ` ✓ Xe.CI.FULL: success for Add ocode late binding support for CRI (rev4) Patchwork

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=ebb9bad7-9df6-41bf-af7d-9275384169e5@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=alexander.usyskin@intel.com \
    --cc=anoop.c.vijay@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=anthony.giardina@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michael.j.ruhl@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=shamim.begum@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 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.