diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-01-24 12:49:35 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-25 20:41:34 +0300 |
commit | a08ef4768f479a712f80426fba42d16253feb37c (patch) | |
tree | 56ad9e7d48e7cac98e2a61a87d9497ea94599d31 /net/tipc | |
parent | 1045ba77a5962a22bce7777678ef46714107ea63 (diff) | |
download | linux-a08ef4768f479a712f80426fba42d16253feb37c.tar.xz |
tipc: uninitialized return code in tipc_setsockopt()
We shuffled some code around and added some new case statements here and
now "res" isn't initialized on all paths.
Fixes: 01fd12bb189a ("tipc: make replicast a user selectable option")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/socket.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 5bec8aac5008..103d1fd058c0 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -2348,7 +2348,7 @@ static int tipc_setsockopt(struct socket *sock, int lvl, int opt, struct sock *sk = sock->sk; struct tipc_sock *tsk = tipc_sk(sk); u32 value = 0; - int res; + int res = 0; if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM)) return 0; @@ -2388,7 +2388,6 @@ static int tipc_setsockopt(struct socket *sock, int lvl, int opt, break; case TIPC_CONN_TIMEOUT: tipc_sk(sk)->conn_timeout = value; - /* no need to set "res", since already 0 at this point */ break; case TIPC_MCAST_BROADCAST: tsk->mc_method.rcast = false; |