diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-04-23 16:27:20 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-05-29 17:05:58 +0200 |
commit | fe6bb59f4dd693ffb678224fe78fc69dda163c46 (patch) | |
tree | e0dcc62270d8c2a0faa4679986203144caa48e15 /drivers/usb/gadget | |
parent | lpfc_debugfs: get rid of pointless access_ok() (diff) | |
download | linux-fe6bb59f4dd693ffb678224fe78fc69dda163c46.tar.xz linux-fe6bb59f4dd693ffb678224fe78fc69dda163c46.zip |
usb: get rid of pointless access_ok() calls
in all affected cases addresses are passed only to
copy_from()_user or copy_to_user().
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/function/f_hid.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index f3816a5c861e..df671acdd464 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c @@ -252,9 +252,6 @@ static ssize_t f_hidg_read(struct file *file, char __user *buffer, if (!count) return 0; - if (!access_ok(buffer, count)) - return -EFAULT; - spin_lock_irqsave(&hidg->read_spinlock, flags); #define READ_COND (!list_empty(&hidg->completed_out_req)) @@ -339,9 +336,6 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer, unsigned long flags; ssize_t status = -ENOMEM; - if (!access_ok(buffer, count)) - return -EFAULT; - spin_lock_irqsave(&hidg->write_spinlock, flags); #define WRITE_COND (!hidg->write_pending) |