This is a note to let you know that I've just added the patch titled bpftool: Fix wrong free call in do_show_link to the 6.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bpftool-fix-wrong-free-call-in-do_show_link.patch and it can be found in the queue-6.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 0f1f19ea08865b922b21784e11410cb2126a25b9 Author: Jiri Olsa <jolsa@xxxxxxxxxx> Date: Fri Jan 19 12:05:00 2024 +0100 bpftool: Fix wrong free call in do_show_link [ Upstream commit 2adb2e0fcdf3c6d8e28a5a9c33e458e1037ae5ad ] The error path frees wrong array, it should be ref_ctr_offsets. Acked-by: Yafang Shao <laoar.shao@xxxxxxxxx> Reviewed-by: Quentin Monnet <quentin@xxxxxxxxxxxxx> Fixes: a7795698f8b6 ("bpftool: Add support to display uprobe_multi links") Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx> Acked-by: Song Liu <song@xxxxxxxxxx> Link: https://lore.kernel.org/r/20240119110505.400573-4-jolsa@xxxxxxxxxx Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> 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;