[PATCH v3 1/3] net: atlantic: AQC113: Ensure L2 filter count is valid
From: Janne Grunau
Date: Fri Nov 27 2026 - 09:54:59 EST
Set l2_filter_count based on l2_filters_base_index if it is out of the
range [1, HW_ATL2_MAC_MAX]. At least one L2 filter slot is required for
the MAC address. When the firmware delivers out of range L2 filter count
values the best option is to compute it based on l2_filters_base_index
which is already validated.
Fixes: 6c1ca112a6e4 ("net: atlantic: fix AQC113 HW init: ART, L2 filter slot, MAC address")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Janne Grunau <j@xxxxxxxxxx>
---
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
index dc9b2ef4640b..9ad5bbb11bdf 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
@@ -629,6 +629,8 @@ int hw_atl2_utils_get_filter_caps(struct aq_hw_s *self)
if (priv->l2_filters_base_index >= HW_ATL2_MAC_MAX)
priv->l2_filters_base_index = HW_ATL2_MAC_UC;
priv->l2_filter_count = filter_caps.l2_filter_count;
+ if (priv->l2_filter_count < 1 || priv->l2_filter_count > HW_ATL2_MAC_MAX)
+ priv->l2_filter_count = HW_ATL2_MAC_MAX - priv->l2_filters_base_index;
priv->etype_filter_base_index = filter_caps.ethertype_filter_base_index;
priv->etype_filter_count = filter_caps.ethertype_filter_count;
priv->etype_filter_tag_top =
--
2.56.1