From aad59c6deefa0336b6289fca1b191d42460e2acc Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 6 May 2025 17:43:49 +0200 Subject: [PATCH] xfree86: common: fix not-found check in xf86platformAddDevice() Safer (and easier to understand) if we look at the result pointer instead of the counter for testing whether device wasn't found. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/common/xf86platformBus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index c7591d2bd..fe734677b 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -685,7 +685,7 @@ xf86platformAddDevice(const char *driver_name, int index) } } - if (i == xf86NumDrivers) { + if (!drvp) { ErrorF("can't find driver %s for hotplugged device\n", driver_name); return -1; }