diff options
-rw-r--r-- | drivers/char/drm/drm_drv.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c index 22957ac15df4..564138714bb5 100644 --- a/drivers/char/drm/drm_drv.c +++ b/drivers/char/drm/drm_drv.c | |||
@@ -470,19 +470,18 @@ int drm_ioctl(struct inode *inode, struct file *filp, | |||
470 | if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END) && | 470 | if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END) && |
471 | (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) | 471 | (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) |
472 | ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; | 472 | ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; |
473 | else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) | 473 | else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) { |
474 | ioctl = &drm_ioctls[nr]; | 474 | ioctl = &drm_ioctls[nr]; |
475 | else | 475 | cmd = ioctl->cmd; |
476 | } else | ||
476 | goto err_i1; | 477 | goto err_i1; |
477 | 478 | ||
478 | /* Do not trust userspace, use our own definition */ | 479 | /* Do not trust userspace, use our own definition */ |
479 | cmd = ioctl->cmd; | ||
480 | func = ioctl->func; | 480 | func = ioctl->func; |
481 | /* is there a local override? */ | 481 | /* is there a local override? */ |
482 | if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl) | 482 | if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl) |
483 | func = dev->driver->dma_ioctl; | 483 | func = dev->driver->dma_ioctl; |
484 | 484 | ||
485 | |||
486 | if (!func) { | 485 | if (!func) { |
487 | DRM_DEBUG("no function\n"); | 486 | DRM_DEBUG("no function\n"); |
488 | retcode = -EINVAL; | 487 | retcode = -EINVAL; |