netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] sock: Fix SO_ZEROCOPY switch case
@ 2018-03-07 17:40 Jesus Sanchez-Palencia
  2018-03-07 17:54 ` Sowmini Varadhan
  2018-03-07 20:55 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jesus Sanchez-Palencia @ 2018-03-07 17:40 UTC (permalink / raw)
  To: netdev; +Cc: willemb, Jesus Sanchez-Palencia

Fix the SO_ZEROCOPY switch case on sock_setsockopt() avoiding the
ret values to be overwritten by the one set on the default case.

Fixes: 28190752c7092 ("sock: permit SO_ZEROCOPY on PF_RDS socket")
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Acked-by: Willem de Bruijn <willemb@google.com>
---
 net/core/sock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index 507d8c6c4319..27f218bba43f 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1062,8 +1062,9 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
 				ret = -EINVAL;
 			else
 				sock_valbool_flag(sk, SOCK_ZEROCOPY, valbool);
-			break;
 		}
+		break;
+
 	default:
 		ret = -ENOPROTOOPT;
 		break;
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-07 20:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-07 17:40 [PATCH net-next] sock: Fix SO_ZEROCOPY switch case Jesus Sanchez-Palencia
2018-03-07 17:54 ` Sowmini Varadhan
2018-03-07 20:55 ` David Miller

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).