aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOsama Abboud <osamaabb@amazon.com>2024-08-07 06:24:22 +0000
committerOsama Abboud <osamaabb@FreeBSD.org>2024-10-31 14:54:10 +0000
commit418d3190d73cdca08bc91ad313bf39ebab3b32af (patch)
tree025d22f1d66557f4fdf0decdb6228fb714ddea12
parent699706f80be9f8f8559f17f1db554b1671043ac4 (diff)
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)
-rw-r--r--sys/dev/ena/ena.c2
1 files changed, 1 insertions, 1 deletions
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: