netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/1] net/smc: remove duplicate check in smc_setsockopt
@ 2018-06-01 14:58 Ursula Braun
  0 siblings, 0 replies; only message in thread
From: Ursula Braun @ 2018-06-01 14:58 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun

From: Ursula Braun <ubraun@linux.ibm.com>

smc_setsockopt contains a check for the length specified on the
setsockopt socket call. If checked, it is supposed to return with
EINVAL. But the equivalent check is already contained in the preceding
setsockopt call on the internal TCP socket. That means, the extra
check can be removed.

Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Fixes: 01d2f7e2cdd3 ("net/smc: sockopts TCP_NODELAY and TCP_CORK")
Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 net/smc/af_smc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 2c369d4bb1c1..dec3f09f6327 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1419,8 +1419,6 @@ static int smc_setsockopt(struct socket *sock, int level, int optname,
 	if (rc)
 		return rc;
 
-	if (optlen < sizeof(int))
-		return rc;
 	get_user(val, (int __user *)optval);
 
 	lock_sock(sk);
-- 
2.16.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-01 14:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-01 14:58 [PATCH net-next 1/1] net/smc: remove duplicate check in smc_setsockopt Ursula Braun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).