net/mld/mld_group.c: Fixed failure to stop queries. This turned out to be an uninitialized variable. I wonder why there was no warning from GCC?

This commit is contained in:
Gregory Nutt 2018-11-11 15:25:16 -06:00
parent 610c187e96
commit 9b1025ca1b
2 changed files with 8 additions and 11 deletions

View file

@ -75,7 +75,7 @@
static int mld_ngroups(FAR struct net_driver_s *dev)
{
FAR struct mld_group_s *group;
int ngroups;
int ngroups = 0;
/* Count the number of groups in the group list */
@ -274,9 +274,6 @@ void mld_grpfree(FAR struct net_driver_s *dev, FAR struct mld_group_s *group)
#ifndef CONFIG_CONFIG_NET_MLD_ROUTER
/* If there are no longer any groups, then stop the general query and v1
* compatibility timers.
*
* REVISIT: Does not work. Continues to query after the last group
* leaves.
*/
if (mld_ngroups(dev) < 1)