[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230411084349.1999628-1-zenghao@kylinos.cn>
Date: Tue, 11 Apr 2023 16:43:49 +0800
From: Hao Zeng <zenghao@...inos.cn>
To: ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
martin.lau@...ux.dev, song@...nel.org, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org, sdf@...gle.com,
haoluo@...gle.com, jolsa@...nel.org, bpf@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Hao Zeng <zenghao@...inos.cn>
Subject: [PATCH] samples/bpf:fix fout leak
Fix fout fopen but not fclose
Signed-off-by: Hao Zeng <zenghao@...inos.cn>
---
samples/bpf/hbm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/bpf/hbm.c b/samples/bpf/hbm.c
index 516fbac28b71..7f89700a17b6 100644
--- a/samples/bpf/hbm.c
+++ b/samples/bpf/hbm.c
@@ -315,6 +315,7 @@ static int run_bpf_prog(char *prog, int cg_id)
fout = fopen(fname, "w");
fprintf(fout, "id:%d\n", cg_id);
fprintf(fout, "ERROR: Could not lookup queue_stats\n");
+ fclose(fout);
} else if (stats_flag && qstats.lastPacketTime >
qstats.firstPacketTime) {
long long delta_us = (qstats.lastPacketTime -
--
2.37.2
No virus found
Checked by Hillstone Network AntiVirus
Powered by blists - more mailing lists