diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-31 21:40:07 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-23 20:50:17 -0700 |
commit | 1865a9c382ede507065cf1575308b53495814c7d (patch) | |
tree | 91e448411ba4a1b8478814253f20ecb8d56a2737 | |
parent | 6d4d4554863b7897f2bc9cd9085f54c819152825 (diff) | |
download | kernel_samsung_crespo-1865a9c382ede507065cf1575308b53495814c7d.zip kernel_samsung_crespo-1865a9c382ede507065cf1575308b53495814c7d.tar.gz kernel_samsung_crespo-1865a9c382ede507065cf1575308b53495814c7d.tar.bz2 |
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>
-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 d240de0..801324a 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; } |