projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d4d455
)
USB: adutux: fix misuse of return value of copy_to_user()
author
Kulikov Vasiliy
<segooon@gmail.com>
Sat, 31 Jul 2010 17:40:07 +0000
(21:40 +0400)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Tue, 24 Aug 2010 03:50:17 +0000
(20:50 -0700)
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>
drivers/usb/misc/adutux.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/misc/adutux.c
b/drivers/usb/misc/adutux.c
index d240de097c6211afd6ff2ef1399c1b2add9ca751..801324af9470a08d5b42011bfa397a03d97cb99d 100644
(file)
--- 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;
}