Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5993420ybc; Wed, 27 Nov 2019 13:04:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzjos0OViAfKabbnRfJVfSMTY2XAINMdnQHtf9LPpg6TJpXC8mWjV4nSTHrbilhVJTL8BqF X-Received: by 2002:a17:906:80ce:: with SMTP id a14mr26086676ejx.118.1574888657591; Wed, 27 Nov 2019 13:04:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888657; cv=none; d=google.com; s=arc-20160816; b=CEbhui0eD2ULl6QUIpjGzUuyszVc6g2x0j5L8ba3ef6eJX1aWaeMZfkCi3rXnI4mfA 3XzhAMfrdypbN29VIJCCkC2GQLJchLN8SdeZKCOM0gV3r/35AOaMBwaxzgEimQH1aPd1 lzeOm/np50MuRG+IMb/pN6Y+Q0apVxHTLnUteXkzBp9zqJQPvzfWRvnKdWnNgSAFgueD T67Q+wsNKgkc0YFZPT9ALNZoLWYGP+14N6/QPctRnOE5PfrkqPhk7cwBIaE4jEVzkBG8 kCoZeokhZ9c8Ceks51oJCvb/CoapJIOy/dLOkgnXeDkeCfr7Rl3QzTsa8zOlQZx3bkt7 DURw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Fi89vmm3ikcdmNg05zEc9HK8wqOZqx0e/maxtVgqK5U=; b=Maz2Gq73qS2HInzHwTfUZDZUoT28FD9uo9BvfSiNZsPvIPIh7oYa92VtinapjS3Zv3 XTdSxOcUab7l8VCRPNeeNyuiwlxqo+N+YfYA0R3bWFB3YaG4k4Iocqvc9yDHM90Ajasc MuJ7JvjxJ71oqio1NWM4K5lThEk5INtuSFFxiPUoxpczLTl70Yk6nF4Ykp9AuYznkkeZ UZ/d6gTV8ttt6ACEs5bxyf9DvwWPa7PCEV1F3arRHm3jXutpGNS0STUkKvezAC7mmZMh 57lYmH4Cx3/wkhirub3oBTmfw+9paZ2BxAt7lap7USQPOrYgAoCYk6mvB3HhaAJULBoP q5ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rK7pIuDs; 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 u24si10067870ejb.93.2019.11.27.13.03.45; Wed, 27 Nov 2019 13:04:17 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=rK7pIuDs; 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 S1731610AbfK0VAt (ORCPT + 99 others); Wed, 27 Nov 2019 16:00:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:52738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731593AbfK0VAq (ORCPT ); Wed, 27 Nov 2019 16:00:46 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B09802086A; Wed, 27 Nov 2019 21:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888446; bh=SqMAJqA3YHvVV9J5WhrstskH1pJ06XfwMtA3zAsaE7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rK7pIuDsIJ8t/hvpo5Bf+obV5TwvMmIQKx2nawwi7Zrx+dSes29Utv9IfhSOkAVKK 2aj+K8qYCLbuTI0mNfzOxhqxVJq00mRNvY+Cz/fO01edWOVlb8IJOBnPhBAIgiseOo 7B8b+HyZsddSg9T5ohNsv20nw7HqQ58wT7EbkMR8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Hao , Daniel Borkmann , Sasha Levin Subject: [PATCH 4.19 100/306] selftests/bpf: fix file resource leak in load_kallsyms Date: Wed, 27 Nov 2019 21:29:10 +0100 Message-Id: <20191127203122.192440697@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Hao [ Upstream commit 1bd70d2eba9d90eb787634361f0f6fa2c86b3f6d ] FILE pointer variable f is opened but never closed. Signed-off-by: Peng Hao Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin --- 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 cf156b3536798..82922f13dcd3a 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; -- 2.20.1