projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f64ac98
)
ip2: return -EFAULT on copy_to_user errors
author
Dan Carpenter
<error27@gmail.com>
Thu, 12 Aug 2010 20:48:59 +0000
(13:48 -0700)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Tue, 24 Aug 2010 01:17:21 +0000
(18:17 -0700)
copy_to_user() returns the number of bytes remaining but we want to return
a negative error code on errors.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: "Michael H. Warfield" <mhw@wittsend.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/ip2/ip2main.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/char/ip2/ip2main.c
b/drivers/char/ip2/ip2main.c
index 8fa041eb8440aae0670a56be1de1f4fced57e352..d4b71e8d0d23a13648be2e55f60f606f55b99edd 100644
(file)
--- a/
drivers/char/ip2/ip2main.c
+++ b/
drivers/char/ip2/ip2main.c
@@
-2930,6
+2930,8
@@
ip2_ipl_ioctl (struct file *pFile, UINT cmd, ULONG arg )
if ( pCh )
{
rc = copy_to_user(argp, pCh, sizeof(i2ChanStr));
+ if (rc)
+ rc = -EFAULT;
} else {
rc = -ENODEV;
}