Commit 78d50217baf36093ab320f95bae0d6452daec85c
Committed by
David S. Miller
1 parent
117980c4c9
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
ipv6: fix array index in ip6_mc_add_src()
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>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
net/ipv6/mcast.c
... | ... | @@ -2044,7 +2044,7 @@ |
2044 | 2044 | if (!delta) |
2045 | 2045 | pmc->mca_sfcount[sfmode]--; |
2046 | 2046 | for (j=0; j<i; j++) |
2047 | - (void) ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]); | |
2047 | + ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]); | |
2048 | 2048 | } else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) { |
2049 | 2049 | struct ip6_sf_list *psf; |
2050 | 2050 |