Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: nishit.sharma@intel.com
To: igt-dev@lists.freedesktop.org, kamil.konieczny@intel.com
Subject: [PATCH] tests/intel/xe_vm: fix double munmap of first mapping
Date: Mon, 31 Aug 2026 16:29:28 +0000	[thread overview]
Message-ID: <20260831162928.201586-1-nishit.sharma@intel.com> (raw)

From: Nishit Sharma <nishit.sharma@intel.com>

In the cleanup path of the bind-array conflict test, when a second buffer
object mapping (map2) exists, the code called munmap() on the first
mapping (map) a second time instead of unmapping map2:

This double-unmaps the map region while leaking the map2 mapping entirely.

Signed-off-by: Nishit Sharma <nishit.sharma@intel.com>
---
 tests/intel/xe_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
index 1d109e783..a0a6616c3 100644
--- a/tests/intel/xe_vm.c
+++ b/tests/intel/xe_vm.c
@@ -1278,7 +1278,7 @@ test_bind_array_conflict(int fd, struct drm_xe_engine_class_instance *eci,
 
 	munmap(map, bo_size);
 	if (map2)
-		munmap(map, bo_size);
+		munmap(map2, bo_size);
 	gem_close(fd, bo);
 	if (bo2)
 		gem_close(fd, bo2);
-- 
2.43.0


             reply	other threads:[~2026-08-31 16:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 16:29 nishit.sharma [this message]
2026-08-31 17:12 ` [PATCH] tests/intel/xe_vm: fix double munmap of first mapping Kamil Konieczny
2026-09-01 12:35 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-09-01 12:38 ` ✓ i915.CI.BAT: " Patchwork
2026-09-01 13:53 ` ✓ Xe.CI.FULL: " Patchwork
2026-09-01 15:03 ` ✓ i915.CI.Full: " 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=20260831162928.201586-1-nishit.sharma@intel.com \
    --to=nishit.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@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