All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shuicheng Lin <shuicheng.lin@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Shuicheng Lin <shuicheng.lin@intel.com>
Subject: [PATCH 0/4] drm/xe: Fix resource leaks in bo init and dma-buf paths
Date: Tue,  7 Apr 2026 20:15:38 +0000	[thread overview]
Message-ID: <20260407201542.3396317-1-shuicheng.lin@intel.com> (raw)

Fix several resource leaks in the xe driver's buffer object
initialization and dma-buf import paths:

Patches 1-2 fix xe_bo_init_locked() where two early validation error
paths return without freeing a caller-provided bo, violating the
documented contract that bo is freed on failure.

Patch 3 fixes xe_dma_buf_init_obj() where the pre-allocated storage bo
is leaked when drm_gpuvm_resv_object_alloc() fails.

Patch 4 fixes xe_gem_prime_import() where the dma-buf attachment is
leaked when xe_dma_buf_init_obj() fails.

Shuicheng Lin (4):
  drm/xe/bo: Fix bo leak on unaligned size validation in
    xe_bo_init_locked()
  drm/xe/bo: Fix bo leak on GGTT flag validation in xe_bo_init_locked()
  drm/xe: Fix bo leak in xe_dma_buf_init_obj() on allocation failure
  drm/xe: Fix dma-buf attachment leak in xe_gem_prime_import()

 drivers/gpu/drm/xe/xe_bo.c      |  8 ++++++--
 drivers/gpu/drm/xe/xe_dma_buf.c | 15 ++++++++++-----
 2 files changed, 16 insertions(+), 7 deletions(-)

-- 
2.43.0


             reply	other threads:[~2026-04-07 20:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 20:15 Shuicheng Lin [this message]
2026-04-07 20:15 ` [PATCH 1/4] drm/xe/bo: Fix bo leak on unaligned size validation in xe_bo_init_locked() Shuicheng Lin
2026-04-08  4:52   ` Matthew Brost
2026-04-07 20:15 ` [PATCH 2/4] drm/xe/bo: Fix bo leak on GGTT flag " Shuicheng Lin
2026-04-08  4:54   ` Matthew Brost
2026-04-07 20:15 ` [PATCH 3/4] drm/xe: Fix bo leak in xe_dma_buf_init_obj() on allocation failure Shuicheng Lin
2026-04-08  5:01   ` Matthew Brost
2026-04-08 15:58     ` Lin, Shuicheng
2026-04-08 16:41       ` Matthew Brost
2026-04-07 20:15 ` [PATCH 4/4] drm/xe: Fix dma-buf attachment leak in xe_gem_prime_import() Shuicheng Lin
2026-04-08  5:04   ` Matthew Brost
2026-04-08 17:34     ` Lin, Shuicheng
2026-04-08 17:38       ` Matthew Brost
2026-04-07 21:48 ` ✗ CI.checkpatch: warning for drm/xe: Fix resource leaks in bo init and dma-buf paths Patchwork
2026-04-07 21:50 ` ✗ CI.KUnit: 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=20260407201542.3396317-1-shuicheng.lin@intel.com \
    --to=shuicheng.lin@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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.