]> git.baikalelectronics.ru Git - kernel.git/commit
usx2y: don't bother with access_ok() in ->dsp_load()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 28 Dec 2017 19:43:06 +0000 (14:43 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 28 Dec 2017 19:43:06 +0000 (14:43 -0500)
commit93efa66831d7e855c4b60ab2acf3ddb15d6ba57b
tree01ef00f78f0f7cb39e8ed55b43f50eacfba3ed2e
parentc6852766d61bd9ef5121f6c0730216d9c4457e52
usx2y: don't bother with access_ok() in ->dsp_load()

memdup_user() checks it, so the only effect would be failing with
-EINVAL instead of -EFAULT in case when access_ok() is false.
However, the caller has already checked access_ok() itself (and
would have buggered off with -EFAULT), so the check is completely
pointless.  Removing it both simplifies the only instance
of ->dsp_load() and allows to get rid of the check in caller -
its sole effect used to be in preventing a bogus error value
from access_ok() in the instance.  Let memdup_user() do the
right thing instead...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
sound/usb/usx2y/usX2Yhwdep.c