OSDN Git Service

compat_ioctl: cdrom: handle CDROM_LAST_WRITTEN
[tomoyo/tomoyo-test1.git] / drivers / cdrom / cdrom.c
index 4809502..faca0f3 100644 (file)
@@ -3293,9 +3293,10 @@ static noinline int mmc_ioctl_cdrom_last_written(struct cdrom_device_info *cdi,
        ret = cdrom_get_last_written(cdi, &last);
        if (ret)
                return ret;
-       if (copy_to_user((long __user *)arg, &last, sizeof(last)))
-               return -EFAULT;
-       return 0;
+       if (in_compat_syscall())
+               return put_user(last, (__s32 __user *)arg);
+
+       return put_user(last, (long __user *)arg);
 }
 
 static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,