summaryrefslogtreecommitdiffstats
path: root/net/atm/resources.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2020-05-10 17:53:35 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2020-05-20 20:31:35 -0400
commit8cacb4165985444c275a6f813f91f08479bdbfad (patch)
tree00cd065ec52d8e90081edbef1fa7380557eea0e3 /net/atm/resources.c
parent36085049bc0acb6f2e784f430c2cc66944a2ef07 (diff)
downloadlinux-8cacb4165985444c275a6f813f91f08479bdbfad.tar.gz
linux-8cacb4165985444c275a6f813f91f08479bdbfad.tar.bz2
linux-8cacb4165985444c275a6f813f91f08479bdbfad.zip
atm: lift copyin from atm_dev_ioctl()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/atm/resources.c')
-rw-r--r--net/atm/resources.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/net/atm/resources.c b/net/atm/resources.c
index 5507cc608969..94bdc6527ee8 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -227,39 +227,14 @@ int atm_getnames(void __user *buf, int __user *iobuf_len)
return error;
}
-int atm_dev_ioctl(unsigned int cmd, void __user *arg, int compat)
+int atm_dev_ioctl(unsigned int cmd, void __user *buf, int __user *sioc_len,
+ int number, int compat)
{
- void __user *buf;
- int error, len, number, size = 0;
+ int error, len, size = 0;
struct atm_dev *dev;
- int __user *sioc_len;
- if (IS_ENABLED(CONFIG_COMPAT) && compat) {
-#ifdef CONFIG_COMPAT
- struct compat_atmif_sioc __user *csioc = arg;
- compat_uptr_t carg;
-
- sioc_len = &csioc->length;
- if (get_user(carg, &csioc->arg))
- return -EFAULT;
- buf = compat_ptr(carg);
-
- if (get_user(len, &csioc->length))
- return -EFAULT;
- if (get_user(number, &csioc->number))
- return -EFAULT;
-#endif
- } else {
- struct atmif_sioc __user *sioc = arg;
-
- sioc_len = &sioc->length;
- if (get_user(buf, &sioc->arg))
- return -EFAULT;
- if (get_user(len, &sioc->length))
- return -EFAULT;
- if (get_user(number, &sioc->number))
- return -EFAULT;
- }
+ if (get_user(len, sioc_len))
+ return -EFAULT;
dev = try_then_request_module(atm_dev_lookup(number), "atm-device-%d",
number);