drm: Copy back ioctl data to userspace regardless of return code.
authorMichel Dänzer <daenzer@vmware.com>
Wed, 20 May 2009 11:32:00 +0000 (13:32 +0200)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 20 May 2009 18:41:41 +0000 (11:41 -0700)
Fixes a regression from commit 9d5b3ffc42f7820e8ee07705496955e4c2c38dd9
('drm: fixup some of the ioctl function exit paths'): The vblank ioctl
needs to update the userspace parameters when interrupted by a signal,
which was prevented by the return code check. This could cause the X
server to hang in drmWaitVBlank().

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/gpu/drm/drm_drv.c

index f01def16a669bbadfa2a44b4493b74eb0891220c..019b7c5782367390783dfa8fada2046872a6e0c8 100644 (file)
@@ -481,7 +481,7 @@ int drm_ioctl(struct inode *inode, struct file *filp,
                }
                retcode = func(dev, kdata, file_priv);
 
-               if ((retcode == 0) && (cmd & IOC_OUT)) {
+               if (cmd & IOC_OUT) {
                        if (copy_to_user((void __user *)arg, kdata,
                                         _IOC_SIZE(cmd)) != 0)
                                retcode = -EFAULT;