Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2363750lqp; Sun, 24 Mar 2024 15:55:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtZJH1PkciguQNI1t13c5MbYDdO4Ry9PK205DDlYnHzNqS5YuMLU4a3HbuwnCxm2G+p9+5VGCTyS01XOHcfNW8mwbI5DcmHfvVYFwMxg== X-Google-Smtp-Source: AGHT+IG4xstvzjHM+mSsKqsY0WBL40BzK+VxlBRV8Pzk0+BhlcnC/T+1ie5teo/4mOla9z0qnSOG X-Received: by 2002:a50:d49e:0:b0:568:c6d5:e13a with SMTP id s30-20020a50d49e000000b00568c6d5e13amr4182832edi.15.1711320947861; Sun, 24 Mar 2024 15:55:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711320947; cv=pass; d=google.com; s=arc-20160816; b=diMhDMVHcze1M5XbYzw8PCzpDY5Th76YdUxrm3O49Bg3zi4vlFBqDa0qxFRBD+Oh4I 6KvRtVn3EuYODe0uqQYzXfPkVyrALh3aq5+kXqBuAVkSYX8/tl8AhnxY3KhbUSbNulFh eP5cyobbbixTn8x21gm5hALSZuD0Ai7kV/kE07Nj+M4IXcMU1WFgz9alD96TrA+zA3yQ 0yIt/h4YFvea29HoNq7WDuRiHgpWxrfwno2FTWZ7/rRrAp5J4orJIwm30PeNqqAzU1eL z7hPSe3y3b+7UdjiQl8/33jvY3HGBTEnmyFLAG3QvrSLSaBtoMsqIDvmwnVQEMH2RHp1 aKSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9QHK01fhNGJQiphW4GJl4ZBUZYcSIEf2zrWhShE+hDI=; fh=4ANtCWnH4NDlEfQJPx/2UkgSkr1/JcU1PU4Hx+OGo3U=; b=EHRFf/OuhCMM8gEVBSKG0I9j8SQqrjOQ1m31VBSd7Iuh/eCdNfeNfcch+dbK0HXexn 1iz4ge2p9h2q6bbXBXRV7o/S1sh2AuF8Xg7AeXsDm8W/jzxDbWNGJlyjUp+RSQbhmd4W FsRHoQAl9QmURoObCjvt1r/rN80uvnFwI8oUUyMxje9P9sbPdewIpGoTUoWS0MdqYJzN oF5G5C3PQGmY0yMSslueenY7qcWOVPspteZLFWK2Ru/RhGs6dlNyxjItvmGELcwkau52 NEaPPtIJaCRykO7CHrXBZwUkh+/USXo0/m3IBTIR6/FpwwxTGmA6XUncHUi0vyEGysF2 w2iw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VV+wVb20; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y10-20020a056402270a00b0056c0a2371a1si763245edd.223.2024.03.24.15.55.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 15:55:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VV+wVb20; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 91CAD1F2171F for ; Sun, 24 Mar 2024 22:55:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D702412B146; Sun, 24 Mar 2024 22:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VV+wVb20" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EEF4112AAEC; Sun, 24 Mar 2024 22:36:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319787; cv=none; b=pnenMjdJ6dJQSA579XlvnLTl5TuYbCzSFRko6/0kriwurC8YTaqoy4LRIm5623yT7f79YmAysM6OIqAFBXxyezWGi9DyK89W/AoF8E40Arv40FnT/bAVkXgScrMvX58MJE+acpxYshSu+hyj8BslZEn1X4BqPSqeggiailzss30= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319787; c=relaxed/simple; bh=PCOZYknRcewXzsIhOF0XD8bL6rrqEfRfHwALBDHzhnQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Esgp3egYLRfZGOSOUK3YYc71dPC2wHzTTTT0VUXAOrBlvaNp235bKd+dgSWT2xXlpszka583SUVTEDJtbkzgkQcMokM9+QRjolXoftiWFZtTeP9zOzKMQbhGOGhka7GGNS7P1BqDcqk82N41SO4ZFq1YoaxUGUotdr9WtiW8mPU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VV+wVb20; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAB22C433C7; Sun, 24 Mar 2024 22:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319786; bh=PCOZYknRcewXzsIhOF0XD8bL6rrqEfRfHwALBDHzhnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VV+wVb20TPm9k7eW4yNETVN8/EVXnwkrJT90sL9Ugis0ahvYQ1Y1qlh0JgdgZm6N8 5SfljofD0UursDmS/5YLT5hm9A4lN2diKRrTDXVRS7kKbIlJBBaQAMg3sT+Twww8vT tTDXRE305GxCXKlNDuY3t+vAqfxIMdX0TnKf9MTU42IBW5D+dcH2U/3yp00sGwjgpd oNtBPxRllmOnr19TTYTi+L3ekGDtopXX0frZBK1AZdizYs3UKota0FB7oKawo/oPx8 +JpWwdkdN4C9GoB+366oO39Gglt+RVJLAEN5l465Zo3ZVLODw9cwHKV9i14gYoSw/J 6r2z72+BfF4mw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiri Olsa , Yafang Shao , Quentin Monnet , Song Liu , Alexei Starovoitov , Sasha Levin Subject: [PATCH 6.8 087/715] bpftool: Fix wrong free call in do_show_link Date: Sun, 24 Mar 2024 18:24:26 -0400 Message-ID: <20240324223455.1342824-88-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jiri Olsa [ Upstream commit 2adb2e0fcdf3c6d8e28a5a9c33e458e1037ae5ad ] The error path frees wrong array, it should be ref_ctr_offsets. Acked-by: Yafang Shao Reviewed-by: Quentin Monnet Fixes: a7795698f8b6 ("bpftool: Add support to display uprobe_multi links") Signed-off-by: Jiri Olsa Acked-by: Song Liu Link: https://lore.kernel.org/r/20240119110505.400573-4-jolsa@kernel.org Signed-off-by: Alexei Starovoitov Signed-off-by: Sasha Levin --- 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