1
0
Fork 0

vxlan: simplify if clause in dev_close

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 56ef9c909b ("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
hifive-unleashed-5.1
Marcelo Ricardo Leitner 2015-03-23 16:23:12 -03:00 committed by David S. Miller
parent b6f15f828d
commit 24c0e6838c
1 changed files with 1 additions and 1 deletions

View File

@ -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)