From patchwork Sun Nov 7 16:55:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Nakryiko X-Patchwork-Id: 12606889 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27DB2C4321E for ; Sun, 7 Nov 2021 16:55:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C2BB610A2 for ; Sun, 7 Nov 2021 16:55:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235151AbhKGQ61 convert rfc822-to-8bit (ORCPT ); Sun, 7 Nov 2021 11:58:27 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:24402 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235981AbhKGQ6Z (ORCPT ); Sun, 7 Nov 2021 11:58:25 -0500 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1A79LT5f014106 for ; Sun, 7 Nov 2021 08:55:42 -0800 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 3c6atctdwq-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 07 Nov 2021 08:55:42 -0800 Received: from intmgw002.25.frc3.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::c) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Sun, 7 Nov 2021 08:55:38 -0800 Received: by devbig019.vll3.facebook.com (Postfix, from userid 137359) id 4C68B8394B9F; Sun, 7 Nov 2021 08:55:36 -0800 (PST) From: Andrii Nakryiko To: , , CC: , , Hengqi Chen Subject: [PATCH v4 bpf-next 7/9] selftests/bpf: avoid duplicate btf__parse() call Date: Sun, 7 Nov 2021 08:55:19 -0800 Message-ID: <20211107165521.9240-8-andrii@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211107165521.9240-1-andrii@kernel.org> References: <20211107165521.9240-1-andrii@kernel.org> MIME-Version: 1.0 X-FB-Internal: Safe X-FB-Source: Intern X-Proofpoint-ORIG-GUID: P-k95a7yDx-k398O1hB2qRRA7mSOc9Zf X-Proofpoint-GUID: P-k95a7yDx-k398O1hB2qRRA7mSOc9Zf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-07_09,2021-11-03_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 phishscore=0 clxscore=1034 mlxscore=0 priorityscore=1501 suspectscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 impostorscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111070110 X-FB-Internal: deliver Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net btf__parse() is repeated after successful setup, leaving the first instance leaked. Remove redundant and premature call. Reviewed-by: Hengqi Chen Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/prog_tests/core_reloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests/core_reloc.c b/tools/testing/selftests/bpf/prog_tests/core_reloc.c index 55ec85ba7375..1041d0c593f6 100644 --- a/tools/testing/selftests/bpf/prog_tests/core_reloc.c +++ b/tools/testing/selftests/bpf/prog_tests/core_reloc.c @@ -433,7 +433,7 @@ static int setup_type_id_case_local(struct core_reloc_test_case *test) static int setup_type_id_case_success(struct core_reloc_test_case *test) { struct core_reloc_type_id_output *exp = (void *)test->output; - struct btf *targ_btf = btf__parse(test->btf_src_file, NULL); + struct btf *targ_btf; int err; err = setup_type_id_case_local(test);