summaryrefslogtreecommitdiffstats
path: root/net/smc
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2018-05-31 04:31:22 +0200
committerDavid S. Miller <davem@davemloft.net>2018-06-03 16:38:28 +0200
commit3dc9f558cdd2dfba06e021a6b85e990d1a0b2641 (patch)
treea5c3ded4c7d0075eff575e51f1dfb42fd4ab7276 /net/smc
parentnet/mlx5: Make function mlx5_fpga_tls_send_teardown_cmd() static (diff)
downloadlinux-3dc9f558cdd2dfba06e021a6b85e990d1a0b2641.tar.xz
linux-3dc9f558cdd2dfba06e021a6b85e990d1a0b2641.zip
net/smc: fix error return code in smc_setsockopt()
Fix to return error code -EINVAL instead of 0 if optlen is invalid. Fixes: 01d2f7e2cdd3 ("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>
Diffstat (limited to 'net/smc')
-rw-r--r--net/smc/af_smc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 2c369d4bb1c1..973b4471b532 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -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);