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
@ -1123,8 +1123,10 @@ set_sndbuf:
|
||||
case SO_TIMESTAMPING_OLD:
|
||||
if (optlen == sizeof(timestamping)) {
|
||||
if (copy_from_sockptr(×tamping, optval,
|
||||
sizeof(timestamping)))
|
||||
return -EFAULT;
|
||||
sizeof(timestamping))) {
|
||||
ret = -EFAULT;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
memset(×tamping, 0, sizeof(timestamping));
|
||||
timestamping.flags = val;
|
||||
|
Loading…
Reference in New Issue
Block a user