From: Jesus Sanchez-Palencia Date: Wed, 7 Mar 2018 17:40:57 +0000 (-0800) Subject: sock: Fix SO_ZEROCOPY switch case X-Git-Tag: Ubuntu-5.0.0-8.9~2754^2~259 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=334e6413134bf8335ec93a9e60213cbc61ef7a62;p=mirror_ubuntu-disco-kernel.git sock: Fix SO_ZEROCOPY switch case 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 Acked-by: Willem de Bruijn Acked-by: Sowmini Varadhan Signed-off-by: David S. Miller --- 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 @@ set_rcvbuf: ret = -EINVAL; else sock_valbool_flag(sk, SOCK_ZEROCOPY, valbool); - break; } + break; + default: ret = -ENOPROTOOPT; break;