From: Marcelo Ricardo Leitner Date: Mon, 23 Mar 2015 19:23:12 +0000 (-0300) Subject: vxlan: simplify if clause in dev_close X-Git-Tag: v4.1-rc1~128^2~169 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Flinux.git;a=commitdiff_plain;h=24c0e6838cb4888366008bd36e0a77a995b18bb7 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 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 Signed-off-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller --- diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 94603ee742ea..6080f8e7b0cd 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)