mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 00:06:36 +00:00
net/smc: fix error return code in smc_setsockopt()
Fix to return error code -EINVAL instead of 0 if optlen is invalid.
Fixes: 01d2f7e2cd
("net/smc: sockopts TCP_NODELAY and TCP_CORK")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8cb77149e8
commit
3dc9f558cd
1 changed files with 1 additions and 1 deletions
|
@ -1420,7 +1420,7 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,
|
|||
return rc;
|
||||
|
||||
if (optlen < sizeof(int))
|
||||
return rc;
|
||||
return -EINVAL;
|
||||
get_user(val, (int __user *)optval);
|
||||
|
||||
lock_sock(sk);
|
||||
|
|
Loading…
Add table
Reference in a new issue