Advertisement
Guest User

drm ioctl patch

a guest
Jul 15th, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
  2. index 98ae00661656..03f695d55fbd 100644
  3. --- a/drivers/gpu/drm/drm_ioctl.c
  4. +++ b/drivers/gpu/drm/drm_ioctl.c
  5. @@ -831,6 +831,9 @@ long drm_ioctl(struct file *filp,
  6.  
  7. dev = file_priv->minor->dev;
  8.  
  9. + if (DRM_IOCTL_TYPE(cmd) != DRM_IOCTL_BASE)
  10. + return -ENOSYS;
  11. +
  12. if (drm_dev_is_unplugged(dev))
  13. return -ENODEV;
  14.  
  15. diff --git a/include/drm/drm_ioctl.h b/include/drm/drm_ioctl.h
  16. index 10100a4bbe2a..afb27cb6a7bd 100644
  17. --- a/include/drm/drm_ioctl.h
  18. +++ b/include/drm/drm_ioctl.h
  19. @@ -68,6 +68,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
  20. unsigned long arg);
  21.  
  22. #define DRM_IOCTL_NR(n) _IOC_NR(n)
  23. +#define DRM_IOCTL_TYPE(n) _IOC_TYPE(n)
  24. #define DRM_MAJOR 226
  25.  
  26. /**
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement