diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 6a0eacafdb19..8f1e49ba65fa 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -331,6 +331,11 @@ static bool tcf_proto_is_empty(struct tcf_proto *tp, bool rtnl_held) static bool tcf_proto_check_delete(struct tcf_proto *tp, bool rtnl_held) { + if (!(tp->ops->flags & TCF_PROTO_OPS_DOIT_UNLOCKED)) { + tp->deleting = true; + return tp->deleting; + } + spin_lock(&tp->lock); if (tcf_proto_is_empty(tp, rtnl_held)) tp->deleting = true;