Skip to contentSkip to conversation

ipv4/igmp: fix build error if !CONFIG_IP_MULTICAST

PATCH Applied Eric Dumazet 2 participants 2 messages May 23, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv4/igmp: fix build error if !CONFIG_IP_MULTICAST

ip_sf_list_clear_all() needs to be defined even if !CONFIG_IP_MULTICAST

Fixes 3580d04aa674 ("ipv4/igmp: fix another memory leak in igmpv3_del_delrec()")
---
 net/ipv4/igmp.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
net/ipv4/igmp.c +11 -11
index 1a8d36dd49d40a0bd352e78e87b87735f894e2cf..eb03153dfe12b23b86d24bd08882354656ccf152 100644
@@ -188,6 +188,17 @@ static void ip_ma_put(struct ip_mc_list *im)
 	     pmc != NULL;					\
 	     pmc = rtnl_dereference(pmc->next_rcu))
 
+static void ip_sf_list_clear_all(struct ip_sf_list *psf)
+{
+	struct ip_sf_list *next;
+
+	while (psf) {
+		next = psf->sf_next;
+		kfree(psf);
+		psf = next;
+	}
+}
+
 #ifdef CONFIG_IP_MULTICAST
 
 /*
@@ -633,17 +644,6 @@ static void igmpv3_clear_zeros(struct ip_sf_list **ppsf)
 	}
 }
 
-static void ip_sf_list_clear_all(struct ip_sf_list *psf)
-{
-	struct ip_sf_list *next;
-
-	while (psf) {
-		next = psf->sf_next;
-		kfree(psf);
-		psf = next;
-	}
-}
-
 static void kfree_pmc(struct ip_mc_list *pmc)
 {
 	ip_sf_list_clear_all(pmc->sources);
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog