aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/flow_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/openvswitch/flow_netlink.c')
-rw-r--r--net/openvswitch/flow_netlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index 691da853bef5..4bdf5e3ac208 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -2306,14 +2306,14 @@ static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa,
2306 2306
2307 struct sw_flow_actions *acts; 2307 struct sw_flow_actions *acts;
2308 int new_acts_size; 2308 int new_acts_size;
2309 int req_size = NLA_ALIGN(attr_len); 2309 size_t req_size = NLA_ALIGN(attr_len);
2310 int next_offset = offsetof(struct sw_flow_actions, actions) + 2310 int next_offset = offsetof(struct sw_flow_actions, actions) +
2311 (*sfa)->actions_len; 2311 (*sfa)->actions_len;
2312 2312
2313 if (req_size <= (ksize(*sfa) - next_offset)) 2313 if (req_size <= (ksize(*sfa) - next_offset))
2314 goto out; 2314 goto out;
2315 2315
2316 new_acts_size = ksize(*sfa) * 2; 2316 new_acts_size = max(next_offset + req_size, ksize(*sfa) * 2);
2317 2317
2318 if (new_acts_size > MAX_ACTIONS_BUFSIZE) { 2318 if (new_acts_size > MAX_ACTIONS_BUFSIZE) {
2319 if ((MAX_ACTIONS_BUFSIZE - next_offset) < req_size) { 2319 if ((MAX_ACTIONS_BUFSIZE - next_offset) < req_size) {