Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 472f5837 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

net_sched: cls_bpf: remove unnecessary iteration and use passed arg

parent e4386456
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -109,20 +109,13 @@ static void __cls_bpf_delete_prog(struct rcu_head *rcu)

static int cls_bpf_delete(struct tcf_proto *tp, unsigned long arg)
{
	struct cls_bpf_head *head = rtnl_dereference(tp->root);
	struct cls_bpf_prog *prog, *todel = (struct cls_bpf_prog *) arg;
	struct cls_bpf_prog *prog = (struct cls_bpf_prog *) arg;

	list_for_each_entry(prog, &head->plist, link) {
		if (prog == todel) {
	list_del_rcu(&prog->link);
	tcf_unbind_filter(tp, &prog->res);
	call_rcu(&prog->rcu, __cls_bpf_delete_prog);
	return 0;
}
	}

	return -ENOENT;
}

static void cls_bpf_destroy(struct tcf_proto *tp)
{