| 1 |
From: Michel Dänzer <daenzer@vmware.com>
|
| 2 |
Date: Wed, 20 May 2009 11:32:00 +0000 (+0200)
|
| 3 |
Subject: drm: Copy back ioctl data to userspace regardless of return code.
|
| 4 |
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=9b6fe313bfce27d4a261257da70196be0ac2bef5
|
| 5 |
|
| 6 |
drm: Copy back ioctl data to userspace regardless of return code.
|
| 7 |
|
| 8 |
Fixes a regression from commit 9d5b3ffc42f7820e8ee07705496955e4c2c38dd9
|
| 9 |
('drm: fixup some of the ioctl function exit paths'): The vblank ioctl
|
| 10 |
needs to update the userspace parameters when interrupted by a signal,
|
| 11 |
which was prevented by the return code check. This could cause the X
|
| 12 |
server to hang in drmWaitVBlank().
|
| 13 |
|
| 14 |
Signed-off-by: Michel Dänzer <daenzer@vmware.com>
|
| 15 |
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
|
| 16 |
---
|
| 17 |
|
| 18 |
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
|
| 19 |
index f01def1..019b7c5 100644
|
| 20 |
--- a/drivers/gpu/drm/drm_drv.c
|
| 21 |
+++ b/drivers/gpu/drm/drm_drv.c
|
| 22 |
@@ -481,7 +481,7 @@ int drm_ioctl(struct inode *inode, struct file *filp,
|
| 23 |
}
|
| 24 |
retcode = func(dev, kdata, file_priv);
|
| 25 |
|
| 26 |
- if ((retcode == 0) && (cmd & IOC_OUT)) {
|
| 27 |
+ if (cmd & IOC_OUT) {
|
| 28 |
if (copy_to_user((void __user *)arg, kdata,
|
| 29 |
_IOC_SIZE(cmd)) != 0)
|
| 30 |
retcode = -EFAULT;
|