Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 96d890daad05 ("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>

authored by

Davide Caratti and committed by
Jakub Kicinski
e16b874e 96216181

+1 -1
+1 -1
net/mptcp/token.c
··· 291 291 { 292 292 struct mptcp_sock *ret = NULL; 293 293 struct hlist_nulls_node *pos; 294 - int slot, num; 294 + int slot, num = 0; 295 295 296 296 for (slot = *s_slot; slot <= token_mask; *s_num = 0, slot++) { 297 297 struct token_bucket *bucket = &token_hash[slot];