Commit 1c1bc6bd authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller

net: cls_basic: return from walking on match in basic_get

As soon as we've found a matching handle in basic_get(), we can
return it. There's no need to continue walking until the end of
a filter chain, since they are unique anyway.
Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
Acked-by: default avatarJiri Pirko <jiri@resnulli.us>
Cc: Thomas Graf <tgraf@suug.ch>
Acked-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fa067467
...@@ -65,9 +65,12 @@ static unsigned long basic_get(struct tcf_proto *tp, u32 handle) ...@@ -65,9 +65,12 @@ static unsigned long basic_get(struct tcf_proto *tp, u32 handle)
if (head == NULL) if (head == NULL)
return 0UL; return 0UL;
list_for_each_entry(f, &head->flist, link) list_for_each_entry(f, &head->flist, link) {
if (f->handle == handle) if (f->handle == handle) {
l = (unsigned long) f; l = (unsigned long) f;
break;
}
}
return l; return l;
} }
......
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