UPSTREAM: usb: raw-gadget: Fix copy_to/from_user() checks
The copy_to/from_user() functions return the number of bytes remaining
but we want to return negative error codes. I changed a couple checks
in raw_ioctl_ep_read() and raw_ioctl_ep0_read() to show that we still
we returning zero on error.
Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface")
Signed-off-by:
Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by:
Andrey Konovalov <andreyknvl@google.com>
Tested-by:
Andrey Konovalov <andreyknvl@google.com>
Link: https://lore.kernel.org/r/20200406145119.GG68494@mwanda
Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 147413187
(cherry picked from commit 068fbff4f860c620c8e36641c1da9a165abad24e)
Change-Id: I771f2c18000e47dd053408b28cbc4c4abb532f67
Signed-off-by:
Andrey Konovalov <andreyknvl@google.com>
Loading
Please register or sign in to comment