netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] vxlan: simplify if clause in dev_close
       [not found] <20150323155612.GD24038@mwanda>
@ 2015-03-23 19:23 ` Marcelo Ricardo Leitner
  2015-03-23 21:02   ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-03-23 19:23 UTC (permalink / raw)
  To: netdev; +Cc: dan.carpenter, kernel-janitors

Dan Carpenter's static checker warned that in vxlan_stop we are checking
if 'vs' can be NULL while later we simply derreference it.

As after commit 56ef9c909b40 ("vxlan: Move socket initialization to
within rtnl scope") 'vs' just cannot be NULL in vxlan_stop() anymore, as
the interface won't go up if the socket initialization fails. So we are
good to just remove the check and make it consistent.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
---
 drivers/net/vxlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 94603ee742eaea4443d8a3de005a622961d1ce4f..6080f8e7b0cd893c3fc05b288a16e3b383f5a14f 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2254,7 +2254,7 @@ static int vxlan_stop(struct net_device *dev)
 	struct vxlan_sock *vs = vxlan->vn_sock;
 	int ret = 0;
 
-	if (vs && vxlan_addr_multicast(&vxlan->default_dst.remote_ip) &&
+	if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip) &&
 	    !vxlan_group_used(vn, vxlan)) {
 		ret = vxlan_igmp_leave(vxlan);
 		if (ret)
-- 
2.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] vxlan: simplify if clause in dev_close
  2015-03-23 19:23 ` [PATCH net-next] vxlan: simplify if clause in dev_close Marcelo Ricardo Leitner
@ 2015-03-23 21:02   ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-03-23 21:02 UTC (permalink / raw)
  To: marcelo.leitner; +Cc: netdev, dan.carpenter, kernel-janitors

From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Mon, 23 Mar 2015 16:23:12 -0300

> Dan Carpenter's static checker warned that in vxlan_stop we are checking
> if 'vs' can be NULL while later we simply derreference it.
> 
> As after commit 56ef9c909b40 ("vxlan: Move socket initialization to
> within rtnl scope") 'vs' just cannot be NULL in vxlan_stop() anymore, as
> the interface won't go up if the socket initialization fails. So we are
> good to just remove the check and make it consistent.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-23 21:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20150323155612.GD24038@mwanda>
2015-03-23 19:23 ` [PATCH net-next] vxlan: simplify if clause in dev_close Marcelo Ricardo Leitner
2015-03-23 21:02   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).