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