diff mbox series

[bpf-next,3/3] libbpf: break loop earlier

Message ID 20171225221325.9680-4-eric@regit.org
State Changes Requested, archived
Delegated to: BPF Maintainers
Headers show
Series add XDP loading support to libbpf | expand

Commit Message

Eric Leblond Dec. 25, 2017, 10:13 p.m. UTC
Get out of the loop when we have a match.

Signed-off-by: Eric Leblond <eric@regit.org>
---
 tools/lib/bpf/libbpf.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 5fe8aaa2123e..d263748aa341 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -412,6 +412,7 @@  bpf_object__init_prog_names(struct bpf_object *obj)
 					   prog->section_name);
 				return -LIBBPF_ERRNO__LIBELF;
 			}
+			break;
 		}
 
 		if (!name) {