diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-31 21:40:07 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-24 07:50:17 +0400 |
commit | 1865a9c382ede507065cf1575308b53495814c7d (patch) | |
tree | 91e448411ba4a1b8478814253f20ecb8d56a2737 /drivers/usb/misc | |
parent | 6d4d4554863b7897f2bc9cd9085f54c819152825 (diff) | |
download | linux-1865a9c382ede507065cf1575308b53495814c7d.tar.xz |
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.c | 2 |
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; } |