From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=from:to:cc:subject:date:message-id; bh=jwyHlQZiMlF5skMniqbyiPT1HEiadnyGyu+iivxuxrs=; b=MfvtXWhTjwKpr8tl7+KKCqYpicUr+q8v88B6Blk5sAWQg/sNwJ9vWlTLNxsVigvqOe vs4nc/HWpv94CtglBAOvOyzC4ywfw/o1Cjh5w0GAgoonKSyJSvkQ+vqS8C4ZZfKWbDK4 +oA50CGspK2Mnzx8TTlIKxPv1f5hm7cI6riVY= From: Roopa Prabhu Date: Tue, 7 Feb 2017 06:43:23 -0800 Message-Id: <1486478603-38776-1-git-send-email-roopa@cumulusnetworks.com> Subject: [Bridge] [PATCH net-next] bridge: remove unnecessary check for vtbegin in br_fill_vlan_tinfo_range List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: davem@davemloft.net Cc: nikolay@cumulusnetworks.com, netdev@vger.kernel.org, bridge@lists.linux-foundation.org, dan.carpenter@oracle.com From: Roopa Prabhu vtbegin should not be NULL in this function, Its already checked by the caller. this should silence the below smatch complaint: net/bridge/br_netlink_tunnel.c:144 br_fill_vlan_tinfo_range() error: we previously assumed 'vtbegin' could be null (see line 130) net/bridge/br_netlink_tunnel.c 129 130 if (vtbegin && vtend && (vtend->vid - vtbegin->vid) > 0) { ^^^^^^^ Check for NULL. Fixes: efa5356b0d97 ("bridge: per vlan dst_metadata netlink support") Reported-By: Dan Carpenter Signed-off-by: Roopa Prabhu --- net/bridge/br_netlink_tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/br_netlink_tunnel.c b/net/bridge/br_netlink_tunnel.c index 99c6801..4c1303b 100644 --- a/net/bridge/br_netlink_tunnel.c +++ b/net/bridge/br_netlink_tunnel.c @@ -127,7 +127,7 @@ static int br_fill_vlan_tinfo_range(struct sk_buff *skb, { int err; - if (vtbegin && vtend && (vtend->vid - vtbegin->vid) > 0) { + if (vtend && (vtend->vid - vtbegin->vid) > 0) { /* add range to skb */ err = br_fill_vlan_tinfo(skb, vtbegin->vid, vtbegin->tinfo.tunnel_id, -- 1.7.10.4