mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-30 13:38:40 +00:00
do_ipv6_setsockopt(): don't open-code memdup_user()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
aa47cc1c3c
commit
43727da90e
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user