mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
sock: unlock on error in sock_setsockopt()
If copy_from_sockptr() then we need to unlock before returning.
Fixes: d463126e23
("net: sock: extend SO_TIMESTAMPING for PHC binding")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d7fba8ff3e
commit
271dbc3184
1 changed files with 4 additions and 2 deletions
|
@ -1123,8 +1123,10 @@ set_sndbuf:
|
||||||
case SO_TIMESTAMPING_OLD:
|
case SO_TIMESTAMPING_OLD:
|
||||||
if (optlen == sizeof(timestamping)) {
|
if (optlen == sizeof(timestamping)) {
|
||||||
if (copy_from_sockptr(×tamping, optval,
|
if (copy_from_sockptr(×tamping, optval,
|
||||||
sizeof(timestamping)))
|
sizeof(timestamping))) {
|
||||||
return -EFAULT;
|
ret = -EFAULT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
memset(×tamping, 0, sizeof(timestamping));
|
memset(×tamping, 0, sizeof(timestamping));
|
||||||
timestamping.flags = val;
|
timestamping.flags = val;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue