mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
USB: iowarrior: 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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
14184f9b80
commit
6d4d455486
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue