tty: handle compat PPP ioctls
authorArnd Bergmann <arnd@arndb.de>
Thu, 6 Jun 2019 08:07:36 +0000 (10:07 +0200)
committerArnd Bergmann <arnd@arndb.de>
Wed, 23 Oct 2019 15:23:47 +0000 (17:23 +0200)
Multiple tty devices are have tty devices that handle the
PPPIOCGUNIT and PPPIOCGCHAN ioctls. To avoid adding a compat_ioctl
handler to each of those, add it directly in tty_compat_ioctl
so we can remove the calls from fs/compat_ioctl.c.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/tty/tty_io.c

index c09691b20a251e2b1183fbee93a8390729167977..a81807b394d1013c53844d27e7cc0f41bbe6af15 100644 (file)
@@ -87,6 +87,7 @@
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/poll.h>
+#include <linux/ppp-ioctl.h>
 #include <linux/proc_fs.h>
 #include <linux/init.h>
 #include <linux/module.h>
@@ -2811,6 +2812,9 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd,
 #endif
        case TIOCGSOFTCAR:
        case TIOCSSOFTCAR:
+
+       case PPPIOCGCHAN:
+       case PPPIOCGUNIT:
                return tty_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
        case TIOCCONS:
        case TIOCEXCL: