diff --git a/xf86drm.c b/xf86drm.c index 87c216cf..e1bbbe99 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -3814,6 +3814,8 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device) return -EINVAL; subsystem_type = drmParseSubsystemType(maj, min); + if (subsystem_type < 0) + return subsystem_type; local_devices = calloc(max_count, sizeof(drmDevicePtr)); if (local_devices == NULL)