projects
/
GitHub
/
LineageOS
/
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:
aa47cc1
)
do_ipv6_setsockopt(): don't open-code memdup_user()
author
Al Viro
<viro@zeniv.linux.org.uk>
Sat, 13 May 2017 22:22:53 +0000
(18:22 -0400)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Fri, 30 Jun 2017 06:04:08 +0000
(
02:04
-0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
net/ipv6/ipv6_sockglue.c
patch
|
blob
|
blame
|
history
diff --git
a/net/ipv6/ipv6_sockglue.c
b/net/ipv6/ipv6_sockglue.c
index a531ba032b85da42d3b5eefcbd9e2e624b5a2868..f8298c9a3160f9eab6f260e7d8b8ddcce4af5fea 100644
(file)
--- a/
net/ipv6/ipv6_sockglue.c
+++ b/
net/ipv6/ipv6_sockglue.c
@@
-735,14
+735,9
@@
done:
retv = -ENOBUFS;
break;
}
- gsf = kmalloc(optlen, GFP_KERNEL);
- if (!gsf) {
- retv = -ENOBUFS;
- break;
- }
- retv = -EFAULT;
- if (copy_from_user(gsf, optval, optlen)) {
- kfree(gsf);
+ gsf = memdup_user(optval, optlen);
+ if (IS_ERR(gsf)) {
+ retv = PTR_ERR(gsf);
break;
}
/* numsrc >= (4G-140)/128 overflow in 32 bits */