git: 5517ca8486bf - main - ena: Fix customer metrics deallocation statement place
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 15 Oct 2024 17:43:00 UTC
The branch main has been updated by osamaabb:
URL: https://cgit.FreeBSD.org/src/commit/?id=5517ca8486bfbf4d0cd369898f3e4d10cd614a9a
commit 5517ca8486bfbf4d0cd369898f3e4d10cd614a9a
Author: Osama Abboud <osamaabb@amazon.com>
AuthorDate: 2024-08-07 06:24:22 +0000
Commit: Osama Abboud <osamaabb@FreeBSD.org>
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: