[Patch net-next] ipv6: remove a useless NULL check

Subsystems: networking [general], networking [ipv4/ipv6], the rest

STALE5084d

2 messages, 2 authors, 2012-11-03 · open the first message on its own page

[Patch net-next] ipv6: remove a useless NULL check

From: Cong Wang <hidden>
Date: 2012-10-29 03:44:07

In dev_forward_change(), it is useless to check if idev->dev
is NULL, it is always non-NULL here.

Reported-by: Fengguang Wu <redacted>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <redacted>

---
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8f0b12a..c9b1cf3 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -607,7 +607,7 @@ static void dev_forward_change(struct inet6_dev *idev)
 	dev = idev->dev;
 	if (idev->cnf.forwarding)
 		dev_disable_lro(dev);
-	if (dev && (dev->flags & IFF_MULTICAST)) {
+	if (dev->flags & IFF_MULTICAST) {
 		if (idev->cnf.forwarding)
 			ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);
 		else

Re: [Patch net-next] ipv6: remove a useless NULL check

From: David Miller <davem@davemloft.net>
Date: 2012-11-03 18:52:16

From: Cong Wang <redacted>
Date: Mon, 29 Oct 2012 11:43:53 +0800
In dev_forward_change(), it is useless to check if idev->dev
is NULL, it is always non-NULL here.

Reported-by: Fengguang Wu <redacted>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help