aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-31 13:40:07 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-23 23:50:17 -0400
commit1865a9c382ede507065cf1575308b53495814c7d (patch)
tree91e448411ba4a1b8478814253f20ecb8d56a2737 /drivers/usb/misc
parent6d4d4554863b7897f2bc9cd9085f54c819152825 (diff)
USB: adutux: 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/adutux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c
index d240de097c62..801324af9470 100644
--- a/drivers/usb/misc/adutux.c
+++ b/drivers/usb/misc/adutux.c
@@ -439,7 +439,7 @@ static ssize_t adu_read(struct file *file, __user char *buffer, size_t count,
439 /* drain secondary buffer */ 439 /* drain secondary buffer */
440 int amount = bytes_to_read < data_in_secondary ? bytes_to_read : data_in_secondary; 440 int amount = bytes_to_read < data_in_secondary ? bytes_to_read : data_in_secondary;
441 i = copy_to_user(buffer, dev->read_buffer_secondary+dev->secondary_head, amount); 441 i = copy_to_user(buffer, dev->read_buffer_secondary+dev->secondary_head, amount);
442 if (i < 0) { 442 if (i) {
443 retval = -EFAULT; 443 retval = -EFAULT;
444 goto exit; 444 goto exit;
445 } 445 }