diff --git a/xf86drm.c b/xf86drm.c index 953fc762..39a82063 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -3141,10 +3141,6 @@ drm_public int drmDevicesEqual(drmDevicePtr a, drmDevicePtr b) static int drmGetNodeType(const char *name) { - if (strncmp(name, DRM_PRIMARY_MINOR_NAME, - sizeof(DRM_PRIMARY_MINOR_NAME) - 1) == 0) - return DRM_NODE_PRIMARY; - if (strncmp(name, DRM_CONTROL_MINOR_NAME, sizeof(DRM_CONTROL_MINOR_NAME ) - 1) == 0) return DRM_NODE_CONTROL; @@ -3153,6 +3149,10 @@ static int drmGetNodeType(const char *name) sizeof(DRM_RENDER_MINOR_NAME) - 1) == 0) return DRM_NODE_RENDER; + if (strncmp(name, DRM_PRIMARY_MINOR_NAME, + sizeof(DRM_PRIMARY_MINOR_NAME) - 1) == 0) + return DRM_NODE_PRIMARY; + return -EINVAL; }