[drm] Fix off-by-one error when accessing driver-specific ioctl handlers array
PR: 231513 Submitted by: Young_X <YangX92@hotmail.com> Approved by: imp MFC after: 1 week
This commit is contained in:
parent
37fd65a0e1
commit
29a92ea6da
@ -745,7 +745,7 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags,
|
||||
if (ioctl->func == NULL && nr >= DRM_COMMAND_BASE) {
|
||||
/* The array entries begin at DRM_COMMAND_BASE ioctl nr */
|
||||
nr -= DRM_COMMAND_BASE;
|
||||
if (nr > dev->driver->max_ioctl) {
|
||||
if (nr >= dev->driver->max_ioctl) {
|
||||
DRM_DEBUG("Bad driver ioctl number, 0x%x (of 0x%x)\n",
|
||||
nr, dev->driver->max_ioctl);
|
||||
return EINVAL;
|
||||
|
Loading…
Reference in New Issue
Block a user