From patchwork Wed Oct 17 13:41:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Hao X-Patchwork-Id: 10645761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE3D5181D for ; Wed, 17 Oct 2018 15:41:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE4FD285B8 for ; Wed, 17 Oct 2018 15:41:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1FD7285C3; Wed, 17 Oct 2018 15:41:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE4C728435 for ; Wed, 17 Oct 2018 15:41:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727186AbeJQXhc (ORCPT ); Wed, 17 Oct 2018 19:37:32 -0400 Received: from mail115-80.sinamail.sina.com.cn ([218.30.115.80]:43956 "HELO mail115-80.sinamail.sina.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727303AbeJQXhc (ORCPT ); Wed, 17 Oct 2018 19:37:32 -0400 X-Greylist: delayed 317 seconds by postgrey-1.27 at vger.kernel.org; Wed, 17 Oct 2018 19:37:31 EDT Received: from unknown (HELO localhost.localdomain.localdomain)([110.184.36.94]) by sina.com with ESMTP id 5BC756CD00007628; Wed, 17 Oct 2018 23:35:50 +0800 (CST) X-Sender: penghao122@sina.com.cn X-Auth-ID: penghao122@sina.com.cn X-SMAIL-MID: 201127132322 From: Peng Hao To: shuah@kernel.org, daniel@iogearbox.net, ast@kernel.org Cc: linux-kselftest@vger.kernel.org, Peng Hao Subject: [PATCH] selftest/bpf : file resource leak Date: Wed, 17 Oct 2018 09:41:25 -0400 Message-Id: <1539783685-5549-1-git-send-email-penghao122@sina.com.cn> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peng Hao 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;