summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2007-09-26 15:38:54 +0100
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2007-09-26 15:39:34 +0100
commitb2c4c7ae5e14598dbb8c1de32918ec9cc8dde7c9 (patch)
treea10eec3c00505e41c0b0ed66b01c05eb65c5b694 /linux-core
parent972ec4fa25059c84ed103c28efcb17f9f97a6d74 (diff)
don't copy back if an error was returned.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_drv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 5d2745e2..e991f117 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -660,7 +660,7 @@ long drm_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
retcode = func(dev, kdata, file_priv);
}
- if (cmd & IOC_OUT) {
+ if ((retcode == 0) && cmd & IOC_OUT) {
if (copy_to_user((void __user *)arg, kdata,
_IOC_SIZE(cmd)) != 0)
retcode = -EACCES;