The arg of ioctl in ppdev is the pointer of integer except the
timeval in PPSETTIME, PPGETTIME. Different size of timeval
is already supported by the previous patches. So, it is safe
to add compat support.

Signed-off-by: Bamvor Jian Zhang <[email protected]>
---
 drivers/char/ppdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 829ebab..8c90cc5 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -675,6 +675,14 @@ static long pp_ioctl(struct file *file, unsigned int cmd, 
unsigned long arg)
        return ret;
 }
 
+#ifdef CONFIG_COMPAT
+static long pp_compat_ioctl(struct file *file, unsigned int cmd,
+               unsigned long arg)
+{
+       return pp_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
+}
+#endif
+
 static int pp_open (struct inode * inode, struct file * file)
 {
        unsigned int minor = iminor(inode);
@@ -784,6 +792,9 @@ static const struct file_operations pp_fops = {
        .write          = pp_write,
        .poll           = pp_poll,
        .unlocked_ioctl = pp_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = pp_compat_ioctl,
+#endif
        .open           = pp_open,
        .release        = pp_release,
 };
-- 
2.1.4

_______________________________________________
Y2038 mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/y2038

Reply via email to