Skip to contentSkip to conversation

bridge: remove unnecessary check for vtbegin in br_fill_vlan_tinfo_range

PATCH Applied Roopa Prabhu via Bridge 2 participants 2 messages Feb 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bridge: remove unnecessary check for vtbegin in br_fill_vlan_tinfo_range

From: Roopa Prabhu <[email protected]>

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")
---
 net/bridge/br_netlink_tunnel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_netlink_tunnel.c +1 -1
index 99c6801..4c1303b 100644
@@ -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,
Signature · 1 line
1.7.10.4
maintainer Applied
#1 lore raw

From: Roopa Prabhu <[email protected]>
Date: Tue, 7 Feb 2017 06:43:23 -0800

Quoted 11 lines

From: Roopa Prabhu <[email protected]>

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

Quoted 7 lines
   130      if (vtbegin && vtend && (vtend->vid - vtbegin->vid) > 0) {
                    ^^^^^^^

Check for NULL.

Fixes efa5356b0d97 ("bridge: per vlan dst_metadata netlink support")

Applied.