From nobody Tue Oct 15 17:43:00 2024 X-Original-To: dev-commits-src-main@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 4XShJh69FCz5Ym23; Tue, 15 Oct 2024 17:43:00 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XShJh5TXRz4YpV; Tue, 15 Oct 2024 17:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729014180; 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=UnzB0PLegsHLh0NInv2KXlpBt9leQvVlnT+owfS6Wrs=; b=CAJ4NQzAk3WkG7qKc+/Gc/Ro9qwSVRHB/S2Bi2IrydIU4JbwRxdX92K1BDvd8o92+FAe7A 0LjYzG1H3EiAXDHWQwWxpQqZNkD/MoKyUGap9rGH5WetTVN8fz7Gq2z7jgXgTiXBGn+csl vxqdrnx4HmWlWp8SOrv6J3ZIy0mxZcROcKEh/av/h8WF8vwL3DaYu+BLQJlk9uCN9cTr3x 5yAAUaBMbsc/Su26kLOD/8BuFEa8+mMfKzTU2HmiR28mxLq8tuf0QJHC7gwYubiBwh7sZH bScwIVF3VQF2x9tvFGabgC6/pkaONuka71Y4g1iScTyqg6BVaSHCNFf3XOzJOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729014180; 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=UnzB0PLegsHLh0NInv2KXlpBt9leQvVlnT+owfS6Wrs=; b=Bb59vtbpz7b2YxcolV3tVxNW88nt0YDdYcxQHZTT1Y1gHFKypPgPrKOAnvP0ANPB8GcfBo NMUxs+PBh3CY4+gMkSEmEFZPPRj2EvYOotHe8zZPCuspYzcuV0wW+ltyOMtf4l6XBe631r cncommOd4559dcTV8HI3ehbrVlzRJciLUP/oyRJEbBi31U6TFkKauwrRVyszR5Twwr5p0w VpGHpvp8hzYU+SucRbMB6SwPnlGDOj0Ax2IbYIS1aEfNJJt5o6bFVXA/yUVARLdv1k10qB +ymZsvafb2ulxqYuooHVcvz4EalJ8WFAPEfNzuhx73zXL6UwZ1LhwYuB2e8L7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729014180; a=rsa-sha256; cv=none; b=gFPyX6jBq4nwIrOIGpiEdNTCPFQi8so3gnfWWiga1DT2h06SnbYByJtK+AokVgIvjk0uI6 GVAMn1hMWtFIVlxXj9N0znCHvsdAlYLUaRq4unO2CHzLUwczxfCmqlyWXhzg0EJ9uOAc14 +WfUCgJkTJd3NYBTZRkpJR3uIxV3CMwyOLmPRe6rtSMQi8xrnK7iBTEeIjzz+9+iWyjdev rQEmctSDpNt7vwkf7+E2Krv2t1q2XPH3V0LJ4GYQVZ4gypwucWszeD2dlzbyPRiWv/bqSZ sEgJrhy3CzQIYFtF/Q8C9DKcjbQ5B80QH9zW1v1888rE7xR4cuDVzRTBYfUDEg== 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 4XShJh554xzXLw; Tue, 15 Oct 2024 17:43:00 +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 49FHh0hB061835; Tue, 15 Oct 2024 17:43:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FHh0CP061832; Tue, 15 Oct 2024 17:43:00 GMT (envelope-from git) Date: Tue, 15 Oct 2024 17:43:00 GMT Message-Id: <202410151743.49FHh0CP061832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Osama Abboud Subject: git: 5517ca8486bf - main - ena: Fix customer metrics deallocation statement place List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5517ca8486bfbf4d0cd369898f3e4d10cd614a9a Auto-Submitted: auto-generated The branch main has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=5517ca8486bfbf4d0cd369898f3e4d10cd614a9a commit 5517ca8486bfbf4d0cd369898f3e4d10cd614a9a Author: Osama Abboud AuthorDate: 2024-08-07 06:24:22 +0000 Commit: Osama Abboud CommitDate: 2024-10-15 17:38:31 +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) MFC after: 2 weeks Sponsored by: Amazon, Inc. --- 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: