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:
14184f9
)
USB: iowarrior: fix misuse of return value of copy_to_user()
author
Kulikov Vasiliy
<segooon@gmail.com>
Sat, 31 Jul 2010 17:39:46 +0000
(21:39 +0400)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Tue, 24 Aug 2010 03:50:16 +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/iowarrior.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/misc/iowarrior.c
b/drivers/usb/misc/iowarrior.c
index 2de49c8887c5f772b0f166cc7b98354f4ad902ea..bc88c79875a146712cae5fcb7461325501f20ad7 100644
(file)
--- a/
drivers/usb/misc/iowarrior.c
+++ b/
drivers/usb/misc/iowarrior.c
@@
-542,7
+542,7
@@
static long iowarrior_ioctl(struct file *file, unsigned int cmd,
retval = io_res;
else {
io_res = copy_to_user(user_buffer, buffer, dev->report_size);
- if (io_res
< 0
)
+ if (io_res)
retval = -EFAULT;
}
break;
@@
-574,7
+574,7
@@
static long iowarrior_ioctl(struct file *file, unsigned int cmd,
}
io_res = copy_to_user((struct iowarrior_info __user *)arg, &info,
sizeof(struct iowarrior_info));
- if (io_res
< 0
)
+ if (io_res)
retval = -EFAULT;
break;
}