[igt-dev] [PATCH i-g-t] lib: Check for a specific match if requested.

Chris Wilson chris at chris-wilson.co.uk
Mon Sep 3 10:04:19 UTC 2018


We only want to allow driver_open to match an unknown driver if asked for
DRIVER_ANY, so we need to double check.

Fixes: 20087bf22698 ("lib: Use a bsearch to find the module name")
Reported-by: Petri Latvala <petri.latvala at intel.com>
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala at intel.com>
---
 lib/drmtest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index adff1a81f..bfa2e0f0a 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -234,7 +234,7 @@ static int open_device(const char *name, unsigned int chipset)
 			break;
 		}
 	}
-	if (chipset & chip)
+	if ((chipset & chip) == chip)
 		return fd;
 
 err:
-- 
2.19.0.rc1



More information about the igt-dev mailing list