2024-05-04 11:38:31

by Dan Carpenter

[permalink] [raw]
Subject: [PATCH] wifi: mwl8k: initialize cmd->addr[] properly

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 <[email protected]>
---
From static analysis. Untested.

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

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);
}
}

--
2.43.0



2024-05-07 12:08:33

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] wifi: mwl8k: initialize cmd->addr[] properly

Dan Carpenter <[email protected]> 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 <[email protected]>

Patch applied to wireless-next.git, thanks.

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

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches