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: 28190752c7 ("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>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jesus Sanchez-Palencia 2018-03-07 09:40:57 -08:00 committed by David S. Miller
parent 92dbb332a2
commit 334e641313
1 changed files with 2 additions and 1 deletions

View File

@ -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;