Skip to content

Commit

Permalink
drm: Fix ioc32 compat layer
Browse files Browse the repository at this point in the history
Previously any ioctls that weren't explicitly listed in the compat ioctl
table would fail with ENOTTY.  If the incoming ioctl number is outside the
range of the table, assume that it Just Works, and pass it off to drm_ioctl.
This make the fence related ioctls work on 64-bit PowerPC.

Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Ian Romanick authored and Dave Airlie committed Feb 7, 2008
1 parent 47a184a commit 7ffa05e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/char/drm/drm_ioc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,8 +1051,12 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
drm_ioctl_compat_t *fn;
int ret;

/* Assume that ioctls without an explicit compat routine will just
* work. This may not always be a good assumption, but it's better
* than always failing.
*/
if (nr >= ARRAY_SIZE(drm_compat_ioctls))
return -ENOTTY;
return drm_ioctl(filp->f_dentry->d_inode, filp, cmd, arg);

fn = drm_compat_ioctls[nr];

Expand Down

0 comments on commit 7ffa05e

Please sign in to comment.