diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-31 19:39:46 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-24 05:50:16 +0200 |
commit | 6d4d4554863b7897f2bc9cd9085f54c819152825 (patch) | |
tree | bdaa33a5a8978d2ab1ef8daedd932598118d8ed8 /drivers/usb/misc | |
parent | USB: xHCI: update ring dequeue pointer when process missed tds (diff) | |
download | linux-6d4d4554863b7897f2bc9cd9085f54c819152825.tar.xz linux-6d4d4554863b7897f2bc9cd9085f54c819152825.zip |
USB: iowarrior: fix misuse of return value of copy_to_user()
copy_to_user() returns number of not copied bytes, not error code.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r-- | drivers/usb/misc/iowarrior.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index 2de49c8887c5..bc88c79875a1 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -542,7 +542,7 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd, retval = io_res; else { io_res = copy_to_user(user_buffer, buffer, dev->report_size); - if (io_res < 0) + if (io_res) retval = -EFAULT; } break; @@ -574,7 +574,7 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd, } io_res = copy_to_user((struct iowarrior_info __user *)arg, &info, sizeof(struct iowarrior_info)); - if (io_res < 0) + if (io_res) retval = -EFAULT; break; } |