comedi: get rid of compat_alloc_user_space() mess in COMEDI_INSN compat
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 26 Apr 2020 00:11:57 +0000 (20:11 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 29 May 2020 14:05:44 +0000 (10:05 -0400)
commitaa332e6759fac21b454e4959703777c771a9cd93
tree22cf2448f7b1aa6a05ed8a7f6d58d97a2a980d5d
parent388138764e2549520afd0b3b4e15de8deb592ff6
comedi: get rid of compat_alloc_user_space() mess in COMEDI_INSN compat

Just take copy_from_user() out of do_insn_ioctl() into the caller and
have compat_insn() build a native version and pass it to do_insn_ioctl()
directly.

One difference from the previous commits is that the helper used to
convert 32bit variant to native has two users - compat_insn() and
compat_insnlist().  The latter will be converted in next commit;
for now we simply split the helper in two variants - "userland 32bit
to kernel native" and "userland 32bit to userland native".  The latter
is renamed old get_compat_insn(); it will be gone in the next commit.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/staging/comedi/comedi_fops.c