Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cavitt <jonathan.cavitt@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: jonathan.cavitt@intel.com, alex.zuo@intel.com,
	dnyaneshwar.bhadane@intel.com
Subject: [PATCH] tests/intel/xe_exec_queue_property: Free eq and vm after test
Date: Fri,  9 Oct 2026 03:42:02 +0800	[thread overview]
Message-ID: <20261008194203.126177-1-jonathan.cavitt@intel.com> (raw)

The function test_set_property() creates both an exec queue and a VM
every run, but fails to free either of them after completion.  This may
result in memory leaks.  Attempt to free them.

Note that the exec queue only needs to be freed if it is expected to be
created.  This is only the case when the expected error value is zero.

Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
---
 tests/intel/xe_exec_queue_property.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/intel/xe_exec_queue_property.c b/tests/intel/xe_exec_queue_property.c
index 3504f19b71..31a2ec2a7d 100644
--- a/tests/intel/xe_exec_queue_property.c
+++ b/tests/intel/xe_exec_queue_property.c
@@ -61,11 +61,17 @@ static void test_set_property(int xe, int property_name,
 		.property = property_name,
 		.value = property_value,
 	};
+	uint32_t vm;
 	uint32_t exec_queue_id;
 
-	igt_assert_eq(__xe_exec_queue_create(xe, xe_vm_create(xe, 0, 0), 1, 1,
-					     &instance, to_user_pointer(&ext),
+	vm = xe_vm_create(xe, 0, 0);
+
+	igt_assert_eq(__xe_exec_queue_create(xe, vm, 1, 1, &instance,
+					     to_user_pointer(&ext),
 					     &exec_queue_id), err_val);
+	if (!err_val)
+		xe_exec_queue_destroy(xe, exec_queue_id);
+	xe_vm_destroy(xe, vm);
 }
 
 static void test_property_min_max(int xe, int engine, const char **property,
-- 
2.43.0


             reply	other threads:[~2026-10-08 19:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 19:42 Jonathan Cavitt [this message]
2026-10-08 21:07 ` ✓ Xe.CI.BAT: success for tests/intel/xe_exec_queue_property: Free eq and vm after test Patchwork
2026-10-08 21:22 ` ✓ i915.CI.BAT: " Patchwork
2026-10-08 22:18 ` ✓ Xe.CI.FULL: " Patchwork
2026-10-09  1:46 ` ✗ i915.CI.Full: failure " Patchwork
2026-10-13 14:08 ` [PATCH] " Kamil Konieczny

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=20261008194203.126177-1-jonathan.cavitt@intel.com \
    --to=jonathan.cavitt@intel.com \
    --cc=alex.zuo@intel.com \
    --cc=dnyaneshwar.bhadane@intel.com \
    --cc=igt-dev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox