diff options
| author | Daniel Borkmann <[email protected]> | 2015-01-22 09:58:18 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2015-01-27 00:08:55 +0000 |
| commit | 1c1bc6bdb7f529eb3383b6e34a0ea327d7e9f615 (patch) | |
| tree | a15d65097742cdd38f9702d07f124c6aae0867e2 /net/sched/cls_basic.c | |
| parent | stmmac: Add an optional device tree property "snps,burst_len" (diff) | |
| download | kernel-1c1bc6bdb7f529eb3383b6e34a0ea327d7e9f615.tar.gz kernel-1c1bc6bdb7f529eb3383b6e34a0ea327d7e9f615.zip | |
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: Daniel Borkmann <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Cc: Thomas Graf <[email protected]>
Acked-by: Thomas Graf <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/sched/cls_basic.c')
| -rw-r--r-- | net/sched/cls_basic.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index 5aed341406c2..fc399db86f11 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c @@ -65,9 +65,12 @@ static unsigned long basic_get(struct tcf_proto *tp, u32 handle) if (head == NULL) return 0UL; - list_for_each_entry(f, &head->flist, link) - if (f->handle == handle) + list_for_each_entry(f, &head->flist, link) { + if (f->handle == handle) { l = (unsigned long) f; + break; + } + } return l; } |
