sock: Fix SO_ZEROCOPY switch case
authorJesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Wed, 7 Mar 2018 17:40:57 +0000 (09:40 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Mar 2018 20:54:46 +0000 (15:54 -0500)
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>
Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c

index 507d8c6c431965242efa19f206a1eef28d0f2cff..27f218bba43fcf27bc6e42f018beec12d39c1930 100644 (file)
@@ -1062,8 +1062,9 @@ set_rcvbuf:
                                ret = -EINVAL;
                        else
                                sock_valbool_flag(sk, SOCK_ZEROCOPY, valbool);
-                       break;
                }
+               break;
+
        default:
                ret = -ENOPROTOOPT;
                break;