Skip to contentSkip to conversation

bridge: cleanup: remove unneed check

PATCH Applied Dan Carpenter 3 participants 3 messages Mar 6, 2010 – Mar 7, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bridge: cleanup: remove unneed check

We dereference "port" on the lines immediately before and immediately after the test so port should hopefully never be null here.

net/bridge/br_multicast.c +2 -2
index 2559fb5..8b25887 100644
@@ -627,8 +627,8 @@ static void br_multicast_port_query_expired(unsigned long data)
 	struct net_bridge *br = port->br;
 
 	spin_lock(&br->multicast_lock);
-	if (port && (port->state == BR_STATE_DISABLED ||
-		     port->state == BR_STATE_BLOCKING))
+	if (port->state == BR_STATE_DISABLED ||
+	    port->state == BR_STATE_BLOCKING)
 		goto out;
 
 	if (port->multicast_startup_queries_sent <
#1 lore raw
Quoted 4 lines · Dan Carpenter

We dereference "port" on the lines immediately before and immediately after the test so port should hopefully never be null here.

Yes this looks correct to me.

Thanks,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt