summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRongQing.Li <roy.qing.li@gmail.com>2012-04-04 16:47:04 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-27 10:16:54 -0700
commit134a84c3bb558e657624ca876685ca1855f06289 (patch)
tree54c02a73422c5bf4f8a730eec4692fd5bdd4a39f
parente4d90d800592947e994f3276cf065ca25c836e8c (diff)
downloadlinux-stable-134a84c3bb558e657624ca876685ca1855f06289.tar.gz
linux-stable-134a84c3bb558e657624ca876685ca1855f06289.tar.bz2
linux-stable-134a84c3bb558e657624ca876685ca1855f06289.zip
ipv6: fix array index in ip6_mc_add_src()
[ Upstream commit 78d50217baf36093ab320f95bae0d6452daec85c ] Convert array index from the loop bound to the loop index. And remove the void type conversion to ip6_mc_del1_src() return code, seem it is unnecessary, since ip6_mc_del1_src() does not use __must_check similar attribute, no compiler will report the warning when it is removed. v2: enrich the commit header Signed-off-by: RongQing.Li <roy.qing.li@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/ipv6/mcast.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 16c33e308121..b2869cab2092 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2044,7 +2044,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
if (!delta)
pmc->mca_sfcount[sfmode]--;
for (j=0; j<i; j++)
- (void) ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]);
+ ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]);
} else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) {
struct ip6_sf_list *psf;