summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2016-06-08 20:11:03 +0100
committerDavid S. Miller <davem@davemloft.net>2016-06-08 21:43:14 -0700
commit6eef3801e719e4ea9c15c01b1d77706f47331166 (patch)
tree81ec3a099747faca686f6c96987368b88bd827d6 /net
parent3497ed8c852a5a3d48957ca91baaa443d9bfcd4d (diff)
net: cls_u32: catch all hardware offload errors
Errors reported by u32_replace_hw_hnode() were not propagated. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/sched/cls_u32.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 27b99fd774d7..54ab32a8ff4c 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -922,11 +922,17 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
ht->divisor = divisor;
ht->handle = handle;
ht->prio = tp->prio;
+
+ err = u32_replace_hw_hnode(tp, ht, flags);
+ if (err) {
+ kfree(ht);
+ return err;
+ }
+
RCU_INIT_POINTER(ht->next, tp_c->hlist);
rcu_assign_pointer(tp_c->hlist, ht);
*arg = (unsigned long)ht;
- u32_replace_hw_hnode(tp, ht, flags);
return 0;
}