diff options
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drm_ioctl.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/linux-core/drm_ioctl.c b/linux-core/drm_ioctl.c index b90e081d..b8ed5a70 100644 --- a/linux-core/drm_ioctl.c +++ b/linux-core/drm_ioctl.c @@ -324,13 +324,15 @@ int drm_setversion(DRM_IOCTL_ARGS) drm_set_version_t retv; int if_version; drm_set_version_t __user *argp = (void __user *)data; - + drm_version_t version; + DRM_COPY_FROM_USER_IOCTL(sv, argp, sizeof(sv)); + dev->driver->version(&version); retv.drm_di_major = DRM_IF_MAJOR; retv.drm_di_minor = DRM_IF_MINOR; - retv.drm_dd_major = DRIVER_MAJOR; - retv.drm_dd_minor = DRIVER_MINOR; + retv.drm_dd_major = version.version_major; + retv.drm_dd_minor = version.version_minor; DRM_COPY_TO_USER_IOCTL(argp, retv, sizeof(sv)); @@ -349,8 +351,8 @@ int drm_setversion(DRM_IOCTL_ARGS) } if (sv.drm_dd_major != -1) { - if (sv.drm_dd_major != DRIVER_MAJOR || - sv.drm_dd_minor < 0 || sv.drm_dd_minor > DRIVER_MINOR) + if (sv.drm_dd_major != version.version_major || + sv.drm_dd_minor < 0 || sv.drm_dd_minor > version.version_minor) return EINVAL; if (dev->driver->set_version) |