aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/drm_ioctl.c')
-rw-r--r--drivers/char/drm/drm_ioctl.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/char/drm/drm_ioctl.c b/drivers/char/drm/drm_ioctl.c
index 9b0feba6b063..a654ac17a900 100644
--- a/drivers/char/drm/drm_ioctl.c
+++ b/drivers/char/drm/drm_ioctl.c
@@ -325,17 +325,13 @@ int drm_setversion(DRM_IOCTL_ARGS)
325 drm_set_version_t retv; 325 drm_set_version_t retv;
326 int if_version; 326 int if_version;
327 drm_set_version_t __user *argp = (void __user *)data; 327 drm_set_version_t __user *argp = (void __user *)data;
328 drm_version_t version;
329 328
330 DRM_COPY_FROM_USER_IOCTL(sv, argp, sizeof(sv)); 329 DRM_COPY_FROM_USER_IOCTL(sv, argp, sizeof(sv));
331 330
332 memset(&version, 0, sizeof(version));
333
334 dev->driver->version(&version);
335 retv.drm_di_major = DRM_IF_MAJOR; 331 retv.drm_di_major = DRM_IF_MAJOR;
336 retv.drm_di_minor = DRM_IF_MINOR; 332 retv.drm_di_minor = DRM_IF_MINOR;
337 retv.drm_dd_major = version.version_major; 333 retv.drm_dd_major = dev->driver->major;
338 retv.drm_dd_minor = version.version_minor; 334 retv.drm_dd_minor = dev->driver->minor;
339 335
340 DRM_COPY_TO_USER_IOCTL(argp, retv, sizeof(sv)); 336 DRM_COPY_TO_USER_IOCTL(argp, retv, sizeof(sv));
341 337
@@ -354,9 +350,9 @@ int drm_setversion(DRM_IOCTL_ARGS)
354 } 350 }
355 351
356 if (sv.drm_dd_major != -1) { 352 if (sv.drm_dd_major != -1) {
357 if (sv.drm_dd_major != version.version_major || 353 if (sv.drm_dd_major != dev->driver->major ||
358 sv.drm_dd_minor < 0 354 sv.drm_dd_minor < 0
359 || sv.drm_dd_minor > version.version_minor) 355 || sv.drm_dd_minor > dev->driver->minor)
360 return EINVAL; 356 return EINVAL;
361 357
362 if (dev->driver->set_version) 358 if (dev->driver->set_version)