diff mbox series

wifi: mwl8k: initialize cmd->addr[] properly

Message ID b788be9a-15f5-4cca-a3fe-79df4c8ce7b2@moroto.mountain (mailing list archive)
State Accepted
Commit 1d60eabb82694e58543e2b6366dae3e7465892a5
Delegated to: Kalle Valo
Headers show
Series wifi: mwl8k: initialize cmd->addr[] properly | expand

Commit Message

Dan Carpenter May 4, 2024, 11:38 a.m. UTC
This loop is supposed to copy the mac address to cmd->addr but the
i++ increment is missing so it copies everything to cmd->addr[0] and
only the last address is recorded.

Fixes: 22bedad3ce11 ("net: convert multicast list to list_head")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
From static analysis.  Untested.

 drivers/net/wireless/marvell/mwl8k.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo May 7, 2024, 12:08 p.m. UTC | #1
Dan Carpenter <dan.carpenter@linaro.org> wrote:

> This loop is supposed to copy the mac address to cmd->addr but the
> i++ increment is missing so it copies everything to cmd->addr[0] and
> only the last address is recorded.
> 
> Fixes: 22bedad3ce11 ("net: convert multicast list to list_head")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Patch applied to wireless-next.git, thanks.

1d60eabb8269 wifi: mwl8k: initialize cmd->addr[] properly
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwl8k.c b/drivers/net/wireless/marvell/mwl8k.c
index 9e534e0a324a..d3d07bb26335 100644
--- a/drivers/net/wireless/marvell/mwl8k.c
+++ b/drivers/net/wireless/marvell/mwl8k.c
@@ -2720,7 +2720,7 @@  __mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti,
 		cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST);
 		cmd->numaddr = cpu_to_le16(mc_count);
 		netdev_hw_addr_list_for_each(ha, mc_list) {
-			memcpy(cmd->addr[i], ha->addr, ETH_ALEN);
+			memcpy(cmd->addr[i++], ha->addr, ETH_ALEN);
 		}
 	}