Skip to contentSkip to conversation

openvswitch: fix error return code in validate_and_copy_dec_ttl()

PATCH Applied Wang Hai 3 participants 3 messages Dec 4, 2020

Subsystems (3)
lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 openvswitch: fix error return code in validate_and_copy_dec_ttl()

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Changing 'return start' to 'return action_start' can fix this bug.

Fixes 69929d4c49e1 ("net: openvswitch: fix TTL decrement action netlink message format")
---
 net/openvswitch/flow_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/openvswitch/flow_netlink.c +1 -1
index ec0689ddc635..4c5c2331e764 100644
@@ -2531,7 +2531,7 @@ static int validate_and_copy_dec_ttl(struct net *net,
 
 	action_start = add_nested_action_start(sfa, OVS_DEC_TTL_ATTR_ACTION, log);
 	if (action_start < 0)
-		return start;
+		return action_start;
 
 	err = __ovs_nla_copy_actions(net, actions, key, sfa, eth_type,
 				     vlan_tci, mpls_label_count, log);
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Wang Hai

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Changing 'return start' to 'return action_start' can fix this bug.

Fixes 69929d4c49e1 ("net: openvswitch: fix TTL decrement action netlink message format")

Thanks for fixing!

Quoted 21 lines
---
 net/openvswitch/flow_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/openvswitch/flow_netlink.c +1 -1
index ec0689ddc635..4c5c2331e764 100644
@@ -2531,7 +2531,7 @@ static int validate_and_copy_dec_ttl(struct net 
 *net,
 
 	action_start = add_nested_action_start(sfa, OVS_DEC_TTL_ATTR_ACTION, 
 log);
 	if (action_start < 0)
-		return start;
+		return action_start;
 
net/openvswitch/flow_netlink.c +0 -0
 	err = __ovs_nla_copy_actions(net, actions, key, sfa, eth_type,
 				     vlan_tci, mpls_label_count, log);
Signature · 1 line
2.17.1
maintainer Applied
#2 lore raw
Quoted 5 lines · On Fri, 04 Dec 2020 13:07:48 +0100 Eelco Chaudron wrote:
Quoted 5 lines

Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.

Changing 'return start' to 'return action_start' can fix this bug.

Quoted 8 lines
Quoted 4 lines
Fixes 69929d4c49e1 ("net: openvswitch: fix TTL decrement action

netlink message format")

Thanks for fixing!

Applied, thanks!