Skip to content

Commit e16b874

Browse files
dcarattikuba-moo
authored andcommitted
mptcp: token: fix unititialized variable
gcc complains about use of uninitialized 'num'. Fix it by doing the first assignment of 'num' when the variable is declared. Fixes: 96d890d ("mptcp: add msk interations helper") Signed-off-by: Davide Caratti <dcaratti@redhat.com> Acked-by: Paolo Abeni <pabeni@redhat.com> Link: https://lore.kernel.org/r/49e20da5d467a73414d4294a8bd35e2cb1befd49.1604308087.git.dcaratti@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 9621618 commit e16b874

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/mptcp/token.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ struct mptcp_sock *mptcp_token_iter_next(const struct net *net, long *s_slot,
291291
{
292292
struct mptcp_sock *ret = NULL;
293293
struct hlist_nulls_node *pos;
294-
int slot, num;
294+
int slot, num = 0;
295295

296296
for (slot = *s_slot; slot <= token_mask; *s_num = 0, slot++) {
297297
struct token_bucket *bucket = &token_hash[slot];

0 commit comments

Comments
 (0)