Commit 6eef3801 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

net: cls_u32: catch all hardware offload errors

Errors reported by u32_replace_hw_hnode() were not propagated.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: default avatarSridhar Samudrala <sridhar.samudrala@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3497ed8c
...@@ -922,11 +922,17 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, ...@@ -922,11 +922,17 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
ht->divisor = divisor; ht->divisor = divisor;
ht->handle = handle; ht->handle = handle;
ht->prio = tp->prio; 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_INIT_POINTER(ht->next, tp_c->hlist);
rcu_assign_pointer(tp_c->hlist, ht); rcu_assign_pointer(tp_c->hlist, ht);
*arg = (unsigned long)ht; *arg = (unsigned long)ht;
u32_replace_hw_hnode(tp, ht, flags);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment