Skip to content

Commit 78d5021

Browse files
RongQing.Lidavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 117980c commit 78d5021

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/mcast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
20442044
if (!delta)
20452045
pmc->mca_sfcount[sfmode]--;
20462046
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]);
20482048
} else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) {
20492049
struct ip6_sf_list *psf;
20502050

0 commit comments

Comments
 (0)