Commit a08ef476 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: 01fd12bb ("tipc: make replicast a user selectable option")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1045ba77
...@@ -2348,7 +2348,7 @@ static int tipc_setsockopt(struct socket *sock, int lvl, int opt, ...@@ -2348,7 +2348,7 @@ static int tipc_setsockopt(struct socket *sock, int lvl, int opt,
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct tipc_sock *tsk = tipc_sk(sk); struct tipc_sock *tsk = tipc_sk(sk);
u32 value = 0; u32 value = 0;
int res; int res = 0;
if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM)) if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM))
return 0; return 0;
...@@ -2388,7 +2388,6 @@ static int tipc_setsockopt(struct socket *sock, int lvl, int opt, ...@@ -2388,7 +2388,6 @@ static int tipc_setsockopt(struct socket *sock, int lvl, int opt,
break; break;
case TIPC_CONN_TIMEOUT: case TIPC_CONN_TIMEOUT:
tipc_sk(sk)->conn_timeout = value; tipc_sk(sk)->conn_timeout = value;
/* no need to set "res", since already 0 at this point */
break; break;
case TIPC_MCAST_BROADCAST: case TIPC_MCAST_BROADCAST:
tsk->mc_method.rcast = false; tsk->mc_method.rcast = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment