From 022be555443eaa3317da6a9a451cf2c9dfcd6ab8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 3 Sep 2018 11:02:14 +0100 Subject: lib: Check for a specific match if requested. We only want to allow driver_open to match an unknown driver if asked for DRIVER_ANY, so we need to double check. Fixes: 9e5fa9112546 ("lib/drmtest: Move open device to separate function") Reported-by: Petri Latvala Signed-off-by: Chris Wilson Cc: Petri Latvala Reviewed-by: Petri Latvala --- lib/drmtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/drmtest.c') diff --git a/lib/drmtest.c b/lib/drmtest.c index adff1a81..bfa2e0f0 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: -- cgit v1.2.3