Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752441AbdL0SDK (ORCPT ); Wed, 27 Dec 2017 13:03:10 -0500 Received: from home.regit.org ([37.187.126.138]:36036 "EHLO home.regit.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752201AbdL0SCp (ORCPT ); Wed, 27 Dec 2017 13:02:45 -0500 From: Eric Leblond To: Alexei Starovoitov Cc: netdev@vger.kernel.org, daniel@iogearbox.net, linux-kernel@vger.kernel.org, Eric Leblond Subject: [PATCH 3/4] libbpf: break loop earlier Date: Wed, 27 Dec 2017 19:02:28 +0100 Message-Id: <20171227180229.1926-4-eric@regit.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171227180229.1926-1-eric@regit.org> References: <20171227022730.y27gwva2u2ilyrul@ast-mbp> <20171227180229.1926-1-eric@regit.org> X-Spam-Score: -1.0 (-) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 502 Lines: 21 Get out of the loop when we have a match. Signed-off-by: Eric Leblond --- tools/lib/bpf/libbpf.c | 1 + 1 file changed, 1 insertion(+) 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) { -- 2.15.1