From nobody Thu Oct 31 15:59:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XfTGM5PvQz5bwNm; Thu, 31 Oct 2024 15:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfTGM4rDFz4Nx8; Thu, 31 Oct 2024 15:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w+jJAA0GmREAi63RqPjf59f59EKjXBI/+5LPSFRYvgY=; b=QIoBtNsVR8+p+fYsYvrIm1fLrmgg134mw4smTYbBXULRKx/gsfYaoXUmGp7ohOuKSnIdxI p+xde6VKPtTY/CjjPQHAOSSYxDOcx2HXaHudwUGfnGsPxW04BvosSL5MJHOdDlwETPFDtD sBlnmLDnVoyLXk/qc/9vMIQuxs+zGKBbRj7A5Wnx1s6BHGUH0nOAGQcEod/vyWl6D8GpzE tvWwktDa2wMJearYNRp3DZ1KMOwGW6dBuJtmLDNzzVGWdN6E1sIUvD8h+Qo6AqfS5NxVfJ am1Upx9fntmbv9MBRT5rCIOnSNSiwzm8mHvJ9Fqvw8PeE6DjsURZ5swzqBon4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w+jJAA0GmREAi63RqPjf59f59EKjXBI/+5LPSFRYvgY=; b=XH+9qGWEte/UgMkd0s86jQEA0rfZIUoOY7K7+7bIXTNFuU4vcGoIRjHMkCcQy9XpzGFbD6 xbXckWiUoH2gNdMQIHbuKUb6v5IjbWmwq9DXPWQM+PczTZSY3yuXO9luvpos0DQ4/0JJYv vvi+gaZf0uJJE7ML2Se/xntZC+shJov3gn5h8yGNusr30Akpa8CLHkhh2OjnBt+FGxSnuC elYjMJqgiiOzvXImaArHz7V6dvDl5MsOlGOsRTDwpI/tRnm3vwgaCqzb8Jn2U4yFIe7m/z hcMzxwAh+Cg/T6G3KfvKKSNE9t3ixZ5xBbMzXuJD2FbUnbVy0SqxMlVU02/5cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390395; a=rsa-sha256; cv=none; b=BBJL2RS72nwsm6WaFC6tW6y4XKFYLzQIqEKNhXh2n7KtSMWJfUWU5PS7ydFuhbONF9yLql iT3MITqc5asRLb2gbrXAabsWUEhbJsph7galo+BVg1ckrQznITKZNecoXA8qg64j82IoGv XAezKt3MTOz7zkaRCapNmCOHmlbvOyEJk6fCR7bMozOQeeQ/372CxjHh3vlhbwU8Kc/yy2 z08rlrXP0YMtVOdCpjJdz/GAKwbaNqw8Fq3537Cw2gk9LwpbHsTsfRV9y0lao21Tir7tor jrnJG5hFixhECLiZAAud+YI5J9m13/wzFy+NE9z+XLzFDURZQcel26vEtHWmuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XfTGM4Rhczj58; Thu, 31 Oct 2024 15:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49VFxtpJ056452; Thu, 31 Oct 2024 15:59:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VFxtK5056449; Thu, 31 Oct 2024 15:59:55 GMT (envelope-from git) Date: Thu, 31 Oct 2024 15:59:55 GMT Message-Id: <202410311559.49VFxtK5056449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 8a31fe8cf91f - stable/13 - ena: Fix customer metrics deallocation statement place List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a31fe8cf91fe8d55579e18e3a683870160cafef Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=8a31fe8cf91fe8d55579e18e3a683870160cafef commit 8a31fe8cf91fe8d55579e18e3a683870160cafef Author: Osama Abboud AuthorDate: 2024-08-07 06:24:22 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +0000 ena: Fix customer metrics deallocation statement place Upstream commit [1] made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). Upstream commit [2] removed the NULL check conducted by the driver. This commit also removes err_customer_metrics_alloc goto label. Commit [2] leaves behind a floating free() statement that deallocates customer_metrics_array. This commit places the deallocation statement where it belongs. [1] commit 4787572d0580 ("ifnet: make if_alloc_domain() never fail") [2] commit aa3860851b9f ("net: Remove unneeded NULL check for the allocated ifnet") Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 5517ca8486bfbf4d0cd369898f3e4d10cd614a9a) --- sys/dev/ena/ena.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 934970ea0cf7..3da424a7c9dd 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3842,8 +3842,8 @@ ena_attach(device_t pdev) #ifdef DEV_NETMAP err_detach: ether_ifdetach(adapter->ifp); -#endif /* DEV_NETMAP */ free(adapter->customer_metrics_array, M_DEVBUF); +#endif /* DEV_NETMAP */ err_metrics_buffer_destroy: ena_com_delete_customer_metrics_buffer(ena_dev); err_msix_free: