Skip to content

Commit

Permalink
vxlan: simplify if clause in dev_close
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Marcelo Ricardo Leitner <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
marceloleitner authored and davem330 committed Mar 23, 2015
1 parent b6f15f8 commit 24c0e68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 24c0e68

Please sign in to comment.