Skip to contentSkip to conversation

net/decnet/dn_route.c: fix inconsequent NULL checking

PATCH Applied Adrian Bunk 3 participants 3 messages Mar 10, 2006 – Mar 15, 2006

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

PATCH 1/1 net/decnet/dn_route.c: fix inconsequent NULL checking

The Coverity checker noted this inconsequent NULL checking in dnrt_drop().

Since all callers ensure that NULL isn't passed, we can simply remove the check.

net/decnet/dn_route.c renamed from net/decnet/dn_route.c.old +1 -2
@@ -149,8 +149,7 @@ static inline void dnrt_free(struct dn_r
 
 static inline void dnrt_drop(struct dn_route *rt)
 {
-	if (rt)
-		dst_release(&rt->u.dst);
+	dst_release(&rt->u.dst);
 	call_rcu_bh(&rt->u.dst.rcu_head, dst_rcu_free);
 }
 
#1 lore raw
Quoted 5 lines · Adrian Bunk

The Coverity checker noted this inconsequent NULL checking in dnrt_drop().

Since all callers ensure that NULL isn't passed, we can simply remove the check.

Ack.

In fact it's pointless even if the caller didn't check as dst_release checks it anyway.

Cheers,

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