From: Jun Zhao Date: Tue, 22 Nov 2011 17:19:03 +0000 (+0000) Subject: ipv4 : igmp : fix error handle in ip_mc_add_src() X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=685f94e6db8496399c881218018166515445a914;p=~shefty%2Frdma-dev.git ipv4 : igmp : fix error handle in ip_mc_add_src() When add sources to interface failure, need to roll back the sfcount[MODE] to before state. We need to match it corresponding. Acked-by: David L Stevens Acked-by: Eric Dumazet Signed-off-by: Jun Zhao Signed-off-by: David S. Miller --- diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index c7472eff2d5..b2ca095cb9d 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -1716,7 +1716,8 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, if (err) { int j; - pmc->sfcount[sfmode]--; + if (!delta) + pmc->sfcount[sfmode]--; for (j=0; jsfcount[MCAST_EXCLUDE] != 0)) {