Skip to content

Commit 24c0e68

Browse files
marceloleitnerdavem330
authored andcommitted
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 56ef9c9 ("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>
1 parent b6f15f8 commit 24c0e68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/vxlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,7 @@ static int vxlan_stop(struct net_device *dev)
22542254
struct vxlan_sock *vs = vxlan->vn_sock;
22552255
int ret = 0;
22562256

2257-
if (vs && vxlan_addr_multicast(&vxlan->default_dst.remote_ip) &&
2257+
if (vxlan_addr_multicast(&vxlan->default_dst.remote_ip) &&
22582258
!vxlan_group_used(vn, vxlan)) {
22592259
ret = vxlan_igmp_leave(vxlan);
22602260
if (ret)

0 commit comments

Comments
 (0)