Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1577314imm; Thu, 18 Oct 2018 00:08:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV6339rd2kF0M651T7Q2g/VezqcIayA3TgCPl943jjAqtQJ2oQPAp0LejQXBVGJbYJUcrACA4 X-Received: by 2002:a65:47cb:: with SMTP id f11-v6mr28012997pgs.166.1539846490023; Thu, 18 Oct 2018 00:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539846489; cv=none; d=google.com; s=arc-20160816; b=egYhDEYNcVdnbIjpQIjhk6GMhFDUrJ0HLmhIb10LNgh1dPwObVovr8NPcPMEyypeWi /Z+l8X6QbjxjwTKlSnLirNvgCYe/1p+r/yIb8gdvzWqnCZMvhd/Gkgg6sKudbRnUwCZ2 XpnkAInFxDEBP30EsgAojsFLb+RfANy8xYo8vG/mhBMZ5O26/Qckz6YNqdqQtlvjcR5D zrACYffDFJzgfQdsFDPrxf5/JrmvEtpCzn1YRpzQCPq/CrBLSleCpA1T2zUTcuiLQoUo KTHWTXww3ie7oKlMYwZXegflR4kaLD4yp6QwRjsYkuBQqEdjnbvikm7ZT9POIzmq2ar8 W8CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=wtIHtTL2OPtMwaaJTTxB3ZKdF6swWOzB4Um9EU6XiEY=; b=L1e8lBvBPMEjFVqYpFIeZHQUmKSfs5OC6mwNcVVrAxjL10Nwvx0TLdg+OADi0oIPSr F++fMd192+BL8gYI9PqQZlyqpMSVfi56/fa4xg2hk8JKe2erSgxNwHTYHqOeUkAutp1l PHuaKpPLiucuDOAj4ZRZL5uzLSEKSqWvD6zLecPOZyor1C9tVN4bJ03ydq7XwB3OVXQP WW8ZEVo/nyNwSnLpCGrAfHXE/mX47259VJr6/NGHdOMU/lOQ6XOj/+/01uzu9C8jvIhp mdwkyfczb1Ek41I0UVG/3FPDnLLUh4ijKmryatcfNMrk5M5Wpp0zkjKM41llOX5Sv2Mx TwcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 74-v6si21276939pga.231.2018.10.18.00.07.53; Thu, 18 Oct 2018 00:08:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727519AbeJRPGz (ORCPT + 99 others); Thu, 18 Oct 2018 11:06:55 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:58834 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbeJRPGz (ORCPT ); Thu, 18 Oct 2018 11:06:55 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 2D8267DCAD06BAB8F18F; Thu, 18 Oct 2018 15:07:18 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id w9I77ANO097048; Thu, 18 Oct 2018 15:07:11 +0800 (GMT-8) (envelope-from peng.hao2@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.74.120.59]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018101815074022-5264126 ; Thu, 18 Oct 2018 15:07:40 +0800 From: Peng Hao To: ast@kernel.org, daniel@iogearbox.net, shuah@kernel.org Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Peng Hao Subject: [PATCH bpf-next] selftests/bpf: fix file resource leak Date: Thu, 18 Oct 2018 23:18:36 +0800 Message-Id: <1539875916-28560-1-git-send-email-peng.hao2@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-10-18 15:07:40, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-10-18 15:06:58, Serialize complete at 2018-10-18 15:06:58 X-MAIL: mse01.zte.com.cn w9I77ANO097048 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org FILE pointer variable f is opened but never closed. Signed-off-by:Peng Hao --- tools/testing/selftests/bpf/trace_helpers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c index cabe2a3..a3d1dac 100644 --- a/tools/testing/selftests/bpf/trace_helpers.c +++ b/tools/testing/selftests/bpf/trace_helpers.c @@ -41,6 +41,7 @@ int load_kallsyms(void) syms[i].name = strdup(func); i++; } + fclose(f); sym_cnt = i; qsort(syms, sym_cnt, sizeof(struct ksym), ksym_cmp); return 0; -- 1.8.3.1