From: Matthew Brost <matthew.brost@intel.com>
To: Varun Gupta <varun.gupta@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
<himal.prasad.ghimiray@intel.com>,
<thomas.hellstrom@linux.intel.com>, <shuicheng.lin@intel.com>
Subject: Re: [PATCH v3] drm/xe: Fix memory leak in xe_vm_madvise_ioctl
Date: Mon, 23 Feb 2026 10:22:01 -0800 [thread overview]
Message-ID: <aZyayQm83eeox4Wt@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20260223175145.1532801-1-varun.gupta@intel.com>
On Mon, Feb 23, 2026 at 11:21:45PM +0530, Varun Gupta wrote:
> When check_bo_args_are_sane() validation fails, jump to the new
> free_vmas cleanup label to properly free the allocated resources.
> This ensures proper cleanup in this error path.
>
> Fixes: 293032eec4ba ("drm/xe/bo: Update atomic_access attribute on madvise")
> Cc: stable@vger.kernel.org # v6.18+
> Reviewed-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Varun Gupta <varun.gupta@intel.com>
> ---
> v3:
> - Corrected Fixes tag to 293032eec4ba (Shuicheng Lin)
> v2:
> - Added Fixes tag and Cc stable (Matt Brost)
> ---
> drivers/gpu/drm/xe/xe_vm_madvise.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_vm_madvise.c b/drivers/gpu/drm/xe/xe_vm_madvise.c
> index 52147f5eaaa0..0c92fed6c6a6 100644
> --- a/drivers/gpu/drm/xe/xe_vm_madvise.c
> +++ b/drivers/gpu/drm/xe/xe_vm_madvise.c
> @@ -453,7 +453,7 @@ int xe_vm_madvise_ioctl(struct drm_device *dev, void *data, struct drm_file *fil
> madvise_range.num_vmas,
> args->atomic.val)) {
> err = -EINVAL;
> - goto madv_fini;
> + goto free_vmas;
> }
> }
>
> @@ -490,6 +490,7 @@ int xe_vm_madvise_ioctl(struct drm_device *dev, void *data, struct drm_file *fil
> err_fini:
> if (madvise_range.has_bo_vmas)
> drm_exec_fini(&exec);
> +free_vmas:
> kfree(madvise_range.vmas);
> madvise_range.vmas = NULL;
> madv_fini:
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-02-23 18:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 17:51 [PATCH v3] drm/xe: Fix memory leak in xe_vm_madvise_ioctl Varun Gupta
2026-02-23 18:22 ` Matthew Brost [this message]
2026-02-23 18:34 ` ✓ CI.KUnit: success for drm/xe: Fix memory leak in xe_vm_madvise_ioctl (rev3) Patchwork
2026-03-02 13:46 ` ✓ CI.KUnit: success for drm/xe: Fix memory leak in xe_vm_madvise_ioctl (rev4) Patchwork
2026-03-02 14:28 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-02 15:32 ` ✗ Xe.CI.FULL: failure " 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=aZyayQm83eeox4Wt@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=shuicheng.lin@intel.com \
--cc=thomas.hellstrom@linux.intel.com \
--cc=varun.gupta@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