From: Raslan Darawsheh <rdaraws...@asaltech.com>

memmove was moving bytes as the number of elements next to i, while it
should move the number of elements multiplied by the size of each element.

Fixes: e9086978 ("mlx5: support VLAN filtering")

Signed-off-by: Raslan Darawsheh <rdarawsheh at asaltech.com>
---
 drivers/net/mlx5/mlx5_vlan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
index 4719e69..fb730e5 100644
--- a/drivers/net/mlx5/mlx5_vlan.c
+++ b/drivers/net/mlx5/mlx5_vlan.c
@@ -87,7 +87,8 @@ vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, 
int on)
                --priv->vlan_filter_n;
                memmove(&priv->vlan_filter[i],
                        &priv->vlan_filter[i + 1],
-                       priv->vlan_filter_n - i);
+                       sizeof(priv->vlan_filter[i]) *
+                       (priv->vlan_filter_n - i));
                priv->vlan_filter[priv->vlan_filter_n] = 0;
        } else {
                assert(i == priv->vlan_filter_n);
-- 
2.1.4

Reply via email to