summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-31 21:40:07 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-23 20:50:17 -0700
commit1865a9c382ede507065cf1575308b53495814c7d (patch)
tree91e448411ba4a1b8478814253f20ecb8d56a2737 /drivers/usb
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')
-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,
/* drain secondary buffer */
int amount = bytes_to_read < data_in_secondary ? bytes_to_read : data_in_secondary;
i = copy_to_user(buffer, dev->read_buffer_secondary+dev->secondary_head, amount);
- if (i < 0) {
+ if (i) {
retval = -EFAULT;
goto exit;
}