From patchwork Mon Mar 23 19:23:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Ricardo Leitner X-Patchwork-Id: 453598 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 029331400A0 for ; Tue, 24 Mar 2015 06:23:36 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753354AbbCWTXc (ORCPT ); Mon, 23 Mar 2015 15:23:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52528 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120AbbCWTXa (ORCPT ); Mon, 23 Mar 2015 15:23:30 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2NJNQZ0008327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 23 Mar 2015 15:23:27 -0400 Received: from localhost.localdomain.com (ovpn-113-27.phx2.redhat.com [10.3.113.27]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2NJNOVJ017331; Mon, 23 Mar 2015 15:23:25 -0400 From: Marcelo Ricardo Leitner To: netdev@vger.kernel.org Cc: dan.carpenter@oracle.com, kernel-janitors@vger.kernel.org Subject: [PATCH net-next] vxlan: simplify if clause in dev_close Date: Mon, 23 Mar 2015 16:23:12 -0300 Message-Id: In-Reply-To: <20150323155612.GD24038@mwanda> References: <20150323155612.GD24038@mwanda> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- drivers/net/vxlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 94603ee742eaea4443d8a3de005a622961d1ce4f..6080f8e7b0cd893c3fc05b288a16e3b383f5a14f 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)