Skip to content

Commit

Permalink
MFC r343060:
Browse files Browse the repository at this point in the history
[drm] Fix off-by-one error when accessing driver-specific ioctl handlers array

PR:		231513
Submitted by:	Young_X <[email protected]>
Approved by:	imp
  • Loading branch information
gonzoua committed Feb 3, 2019
1 parent a4b3d87 commit c53a074
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/dev/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c53a074

Please sign in to comment.