All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] lib/igt_chamelium: Extend check of valid ports to port=0
@ 2022-07-15 19:22 Mark Yacoub
  2022-07-15 19:29 ` Alexandru M Stan
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Mark Yacoub @ 2022-07-15 19:22 UTC (permalink / raw)
  To: igt-dev
  Cc: robdclark, amstan, petri.latvala, ihf, seanpaul,
	khaled.almahallawy, markyacoub

[Why]
Chamelium V3 has a valid port at 0 so 0 should not be rejected.

[How]
Check for port values between 0 and CHAMELIUM_MAX_PORTS which should
also include the V2 ports range.

Test: ./kms_chamelium --run-subtest dp-hp
Tested on: Volteer & cv3

Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
---
 lib/igt_chamelium.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index 55cbfa12..5d68372b 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -2311,7 +2311,7 @@ static bool chamelium_read_port_mappings(struct chamelium *chamelium,
 		port->id = g_key_file_get_integer(igt_key_file, group,
 						  "ChameliumPortID",
 						  &error);
-		if (!port->id) {
+		if (port->id < 0 || port->id > CHAMELIUM_MAX_PORTS) {
 			igt_warn("Failed to read chamelium port ID for %s: %s\n",
 				 map_name, error->message);
 			ret = false;
-- 
2.37.0.170.g444d1eabd0-goog

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-08-01 12:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-15 19:22 [igt-dev] [PATCH] lib/igt_chamelium: Extend check of valid ports to port=0 Mark Yacoub
2022-07-15 19:29 ` Alexandru M Stan
2022-07-29 13:15   ` Petri Latvala
2022-07-16 15:41 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-07-16 17:15 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-07-18 14:42   ` Mark Yacoub
2022-07-18 21:39     ` Vudum, Lakshminarayana
2022-07-18 15:05 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2022-07-29 13:12 ` [igt-dev] [PATCH] " Petri Latvala
2022-07-29 14:53   ` Mark Yacoub
2022-07-29 14:51 ` [igt-dev] [PATCH v2] lib/igt_chamelium: Check for error instead of port id for invalid Mark Yacoub
2022-08-01 10:07   ` Petri Latvala
2022-08-01 12:21 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_chamelium: Extend check of valid ports to port=0 (rev2) Patchwork

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.