All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Michał Grzelak" <michal.grzelak@intel.com>
Cc: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v11 4/8] drm/i915/bios: de/allocate VS/PE-O buffers for each port
Date: Thu, 13 Aug 2026 16:17:45 +0000	[thread overview]
Message-ID: <20260813161746.A10EE1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260813160918.918857-5-michal.grzelak@intel.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Memory leak of devdata->entries during driver removal.
- [Low] Missing initialization of `num_entries` in `devdata->vspeo`.
--

--- Patch [4]: [PATCH v11 4/8] drm/i915/bios: de/allocate VS/PE-O buffers for each port ---
commit f4e52d6386e66ed2695365f0776e18c426ae4237
Author: Michał Grzelak <michal.grzelak@intel.com>

drm/i915/bios: de/allocate VS/PE-O buffers for each port
    
This patch allocates dedicated VS/PE-O buffers for each port if an
override is requested and supported. It adds intel_ddi_buf_trans and
entries fields to intel_bios_encoder_data and handles their allocation
and deallocation.

> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index 9610b794bc147..a491b85006117 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
[ ... ]
> @@ -2648,6 +2651,29 @@ static void sanitize_device_type(struct intel_bios_encoder_data *devdata,
> +static void allocate_vswing_preemph_override(struct intel_bios_encoder_data *devdata)
> +{
> +	int num_rows = devdata->display->vbt.vspeo.num_rows;
> +	union intel_ddi_buf_trans_entry *entries;
> +	struct intel_ddi_buf_trans *vspeo;
> +
> +	if (!intel_bios_encoder_requests_vspeo(devdata))
> +		return;
> +
> +	vspeo = kzalloc_obj(*vspeo);
> +	if (!vspeo)
> +		return;
> +
> +	entries = kzalloc_objs(*entries, num_rows);
> +	if (!entries) {
> +		kfree(vspeo);
> +		return;
> +	}
> +
> +	devdata->vspeo = vspeo;
> +	devdata->entries = entries;

[Severity: Low]
Is this code missing the initialization of devdata->vspeo->num_entries?

The commit message notes for v4->v5 say "- set devdata->vspeo->num_entries in
intel_bios.c", but this doesn't seem to be happening here. Leaving this at 0
would make the table appear empty.

> +}
[ ... ]
> @@ -3403,6 +3430,11 @@ void intel_bios_driver_remove(struct intel_display *display)
>  	list_for_each_entry_safe(devdata, nd, &display->vbt.display_devices,
>  				 node) {
>  		list_del(&devdata->node);
> +
> +		if (devdata->vspeo)
> +			kfree(devdata->vspeo->entries);

[Severity: Medium]
Will this leak the entries buffer allocated in
allocate_vswing_preemph_override()?

Because devdata->vspeo->entries is never initialized in this patch, it remains
NULL, and kfree(NULL) is a no-op. Should this be kfree(devdata->entries)
instead?

> +
> +		kfree(devdata->vspeo);
>  		kfree(devdata->dsc);
>  		kfree(devdata);
>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260813160918.918857-1-michal.grzelak@intel.com?part=4

  reply	other threads:[~2026-08-13 16:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 16:09 [PATCH v11 0/8] Vswing / Pre-emphasis Override Michał Grzelak
2026-08-13 16:09 ` [PATCH v11 1/8] drm/i915/bios: search for VBT #57 by default Michał Grzelak
2026-08-13 16:09 ` [PATCH v11 2/8] drm/i915/bios: store VBT #57's metadata in intel_vbt_data Michał Grzelak
2026-08-13 16:20   ` sashiko-bot
2026-08-13 16:09 ` [PATCH v11 3/8] drm/i915/bios: print VS/PE-O port info Michał Grzelak
2026-08-13 16:09 ` [PATCH v11 4/8] drm/i915/bios: de/allocate VS/PE-O buffers for each port Michał Grzelak
2026-08-13 16:17   ` sashiko-bot [this message]
2026-08-13 16:09 ` [PATCH v11 5/8] drm/i915/buf_trans: add vfunc for VS/PE-O Michał Grzelak
2026-08-13 16:09 ` [PATCH v11 6/8] drm/i915: override Snps's VS/PE when requested Michał Grzelak
2026-08-13 16:29   ` sashiko-bot
2026-08-13 16:09 ` [PATCH v11 7/8] drm/i915: override Combo's " Michał Grzelak
2026-08-13 16:50   ` sashiko-bot
2026-08-13 16:09 ` [PATCH v11 8/8] drm/i915/bios: remove VS/PE-O warning Michał Grzelak
2026-08-13 16:18 ` ✗ CI.checkpatch: warning for Vswing / Pre-emphasis Override (rev6) Patchwork
2026-08-13 16:20 ` ✓ CI.KUnit: success " Patchwork
2026-08-13 17:19 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-13 19:16 ` ✓ Xe.CI.FULL: " Patchwork
2026-08-13 19:16 ` ✓ i915.CI.BAT: " 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=20260813161746.A10EE1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.grzelak@intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.