[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240324223455.1342824-88-sashal@kernel.org>
Date: Sun, 24 Mar 2024 18:24:26 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Jiri Olsa <jolsa@...nel.org>,
Yafang Shao <laoar.shao@...il.com>,
Quentin Monnet <quentin@...valent.com>,
Song Liu <song@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 6.8 087/715] bpftool: Fix wrong free call in do_show_link
From: Jiri Olsa <jolsa@...nel.org>
[ Upstream commit 2adb2e0fcdf3c6d8e28a5a9c33e458e1037ae5ad ]
The error path frees wrong array, it should be ref_ctr_offsets.
Acked-by: Yafang Shao <laoar.shao@...il.com>
Reviewed-by: Quentin Monnet <quentin@...valent.com>
Fixes: a7795698f8b6 ("bpftool: Add support to display uprobe_multi links")
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Acked-by: Song Liu <song@...nel.org>
Link: https://lore.kernel.org/r/20240119110505.400573-4-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
tools/bpf/bpftool/link.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/link.c b/tools/bpf/bpftool/link.c
index cb46667a6b2e7..35b6859dd7c3d 100644
--- a/tools/bpf/bpftool/link.c
+++ b/tools/bpf/bpftool/link.c
@@ -977,7 +977,7 @@ static int do_show_link(int fd)
cookies = calloc(count, sizeof(__u64));
if (!cookies) {
p_err("mem alloc failed");
- free(cookies);
+ free(ref_ctr_offsets);
free(offsets);
close(fd);
return -ENOMEM;
--
2.43.0
Powered by blists - more mailing lists