From nobody Thu Oct 31 16:01:21 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 4XfTJ13nlZz5bwd8; Thu, 31 Oct 2024 16:01:21 +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 4XfTJ12pm5z4SW6; Thu, 31 Oct 2024 16:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390481; 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=RMw3PSpLeIGU9LwtzRDivjV3X6lQ1EqqwL73f4okzdk=; b=kQgrBZlGqnnEauZRBGLAnq+foUTI9DGbFiImyuBYUF4if71TLiQYUU+H61WkrQ97Doz3ZB swWT1onPvE0VuxcUitt30cy1LNxkGfaTIaPCWhU80s25ApeqqREwTr+HCCQ8VzaN8X89g8 T1GyDFZr6/scLXaPARXR2sYFtL56Z68kI4/4b1v2AlNsDbUkNtcZ5v/g+gh4kWf1/079wx gZNWKiwqKjoh6r2jRJ0G8d3X5V74FZqTImkWIhQFJc3p02doFPTQmaSZf8PvJx+sTLhBz8 JR3gnPCzh7JYwf6hvX8Eg0oVYMa7fu5sMxZiLyvtJnMXkTBE9UZriHO6Y65Fag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390481; 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=RMw3PSpLeIGU9LwtzRDivjV3X6lQ1EqqwL73f4okzdk=; b=K1qBtEHp6nLt4ybX/y7npOTex3SNRzNt98ghlVWggd+4WrY84z5LyStGD75NBOqQnfsFRL 63epoVaWVpBOEtppC3V8SUsXfGwwQtLXeo37VGM8/Nkxi7u67cAszkbwlQmPGRSFlAB9ny vCOcSRY6nVWMakp3lcA1RhwuZSiPewUc6w9sCk33bGoXmwuMV1t2A5VnjdmqsBKrG/bC+Q jBgDUL2gkPfXbO6N2gpZHpS+MLHSGGeMAXI1CPKf0CM7fh73GURycDw5tO7RSpiQeRUzWK mBsQgb8YNLXnZjKTdPP+FtGheXOEg2Y8Eq/aWYyrnH/vkFWAgBj+6QeTC+J0tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390481; a=rsa-sha256; cv=none; b=N0kNAdcUThuDXlCA3cd/lDey+6e05Zx/UesKSWPcf2QL+DQnCZppgBP1z8M18xY4FBCggQ kaZI5dMpxZ9vjjmfgQtXTHUOTffLBGjoDUeNBcRnjrgXD9VALNHJXJe6owgbi2ixhIVszO bNofz0erpvyfn8gV7w9K+CEpjYaFDfMf183coXG5MSFveytA4owDRS1hn/Lgmf+f09tHsC eWibNqugWCZRCGrDV5gXfT8tNmky2LpmLDM0Y0m84u3ibDBLA+P4uk+/9e+wl0RJwPrJIQ Y4/VswHvNnTqXz1S9NzipoV7fIA3E1C6+0/WLMOxSgtvaQeC65UxUzKgKGjUlA== 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 4XfTJ129cbzjVm; Thu, 31 Oct 2024 16:01:21 +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 49VG1Ldg069855; Thu, 31 Oct 2024 16:01:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG1L8c069852; Thu, 31 Oct 2024 16:01:21 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:01:21 GMT Message-Id: <202410311601.49VG1L8c069852@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: 418d3190d73c - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 418d3190d73cdca08bc91ad313bf39ebab3b32af Auto-Submitted: auto-generated The branch stable/14 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=418d3190d73cdca08bc91ad313bf39ebab3b32af commit 418d3190d73cdca08bc91ad313bf39ebab3b32af Author: Osama Abboud AuthorDate: 2024-08-07 06:24:22 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:54:10 +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 47d066a2e4f1..9d047cc89b30 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3841,8 +3841,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: