Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24c0e683 authored by Marcelo Ricardo Leitner's avatar Marcelo Ricardo Leitner Committed by David S. Miller
Browse files

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 56ef9c90 ("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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b6f15f82
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)