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 <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-05-06 17:43:49 +02:00
parent d3c4e100ed
commit aad59c6dee

View File

@ -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;
}