public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Karthik B S <karthik.b.s@intel.com>
Subject: [PATCH i-g-t v2 3/5] tests/prime_udl: Fix error handling
Date: Wed, 22 Apr 2026 17:44:21 +0200	[thread overview]
Message-ID: <20260422154423.141908-4-kamil.konieczny@linux.intel.com> (raw)
In-Reply-To: <20260422154423.141908-1-kamil.konieczny@linux.intel.com>

Open function returns -1 on error so error check was never hit.
Fix it and handle it properly.

Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
---
 tests/prime_udl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/prime_udl.c b/tests/prime_udl.c
index b1524e6de..5d2c952d5 100644
--- a/tests/prime_udl.c
+++ b/tests/prime_udl.c
@@ -47,11 +47,11 @@ static int find_and_open_devices(void)
 		sprintf(path, "/dev/dri/card%d", i);
 		if (venid == 0x8086 && intel_fd == -1) {
 			intel_fd = open(path, O_RDWR);
-			if (!intel_fd)
+			if (intel_fd == -1)
 				return -1;
 		} else if (venid == 0x17e9 && udl_fd == -1) {
 			udl_fd = open(path, O_RDWR);
-			if (!udl_fd)
+			if (udl_fd == -1)
 				return -1;
 		}
 	}
-- 
2.54.0


  parent reply	other threads:[~2026-04-22 15:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 15:44 [PATCH i-g-t v2 0/5] Various fixes for prime_udl test Kamil Konieczny
2026-04-22 15:44 ` [PATCH i-g-t v2 1/5] tests/prime_udl: Fix opening Kamil Konieczny
2026-04-22 15:44 ` [PATCH i-g-t v2 2/5] tests/prime_udl: Create subtests Kamil Konieczny
2026-04-23 10:25   ` Karthik B S
2026-04-22 15:44 ` Kamil Konieczny [this message]
2026-04-22 15:44 ` [PATCH i-g-t v2 4/5] tests/prime_udl: Fix i915 device opening Kamil Konieczny
2026-04-22 15:44 ` [PATCH i-g-t v2 5/5] tests/prime_udl: Rename into i915_prime_udl Kamil Konieczny
2026-04-23 10:29   ` Karthik B S
2026-04-24 12:47     ` Kamil Konieczny
2026-04-27  3:43       ` Karthik B S
2026-04-22 23:00 ` ✗ i915.CI.BAT: failure for Various fixes for prime_udl test (rev3) Patchwork
2026-04-23  0:03 ` ✓ Xe.CI.BAT: success " Patchwork
2026-04-23  8:15 ` ✗ 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=20260422154423.141908-4-kamil.konieczny@linux.intel.com \
    --to=kamil.konieczny@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@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