diff mbox

[RFC,1/2] mcastv6: Local variable shadows function argument

Message ID 1248028721-24244-2-git-send-email-gerrit@erg.abdn.ac.uk
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Gerrit Renker July 19, 2009, 6:38 p.m. UTC
The local variable 'idev' shadows the function argument 'idev' to
ip6_mc_add_src(). 

Reported-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
 net/ipv6/mcast.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Stevens July 20, 2009, 2:50 p.m. UTC | #1
pmc->idev should be equal to idev, so you should be able
to simply remove the extra declaration and leave the other
code as it is-- i.e., a 1-line change.

                                        +-DLS

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2107,7 +2107,6 @@  static int ip6_mc_add_src(struct inet6_d
 		for (j=0; j<i; j++)
 			(void) ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]);
 	} else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) {
-		struct inet6_dev *idev = pmc->idev;
 		struct ip6_sf_list *psf;
 
 		/* filter mode change */
@@ -2117,11 +2116,11 @@  static int ip6_mc_add_src(struct inet6_d
 			pmc->mca_sfmode = MCAST_INCLUDE;
 		/* else no filters; keep old mode for reports */
 
-		pmc->mca_crcount = idev->mc_qrv;
-		idev->mc_ifc_count = pmc->mca_crcount;
+		pmc->mca_crcount = pmc->idev->mc_qrv;
+		pmc->idev->mc_ifc_count = pmc->mca_crcount;
 		for (psf=pmc->mca_sources; psf; psf = psf->sf_next)
 			psf->sf_crcount = 0;
-		mld_ifc_event(idev);
+		mld_ifc_event(pmc->idev);
 	} else if (sf_setstate(pmc))
 		mld_ifc_event(idev);
 	spin_unlock_bh(&pmc->mca_lock);