Skip to content

Commit

Permalink
sock: Fix SO_ZEROCOPY switch case
Browse files Browse the repository at this point in the history
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: 2819075 ("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>
  • Loading branch information
Jesus Sanchez-Palencia authored and David S. Miller committed Mar 7, 2018
1 parent 92dbb33 commit 334e641
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 334e641

Please sign in to comment.