diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 70b357f2339108c9e4f4fed60d4df4108fc72175..25a4d64b82db58de7a63358c1632c709374cd5a5 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -1500,6 +1500,14 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, if (!tc_in_hw(fnew->flags)) fnew->flags |= TCA_CLS_FLAGS_NOT_IN_HW; + /* tp was deleted concurrently. -EAGAIN will cause caller to lookup + * proto again or create new one, if necessary. + */ + if (tp->deleting) { + err = -EAGAIN; + goto errout_hw; + } + refcount_inc(&fnew->refcnt); if (fold) { /* Fold filter was deleted concurrently. Retry lookup. */