Commit 3e84f938 authored by Jes Sorensen's avatar Jes Sorensen Committed by Kalle Valo

rtl8xxxu: Use size of source pointer when copying efuse data

Some newer chips have more channel groups in their efuse parameter
tables, so use the size of the source, rather than the destination
when copying them out. This avoids copying garbage when increasing the
common array sizes.
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent e796dab4
...@@ -2318,31 +2318,31 @@ static int rtl8723au_parse_efuse(struct rtl8xxxu_priv *priv) ...@@ -2318,31 +2318,31 @@ static int rtl8723au_parse_efuse(struct rtl8xxxu_priv *priv)
memcpy(priv->cck_tx_power_index_A, memcpy(priv->cck_tx_power_index_A,
efuse->cck_tx_power_index_A, efuse->cck_tx_power_index_A,
sizeof(priv->cck_tx_power_index_A)); sizeof(efuse->cck_tx_power_index_A));
memcpy(priv->cck_tx_power_index_B, memcpy(priv->cck_tx_power_index_B,
efuse->cck_tx_power_index_B, efuse->cck_tx_power_index_B,
sizeof(priv->cck_tx_power_index_B)); sizeof(efuse->cck_tx_power_index_B));
memcpy(priv->ht40_1s_tx_power_index_A, memcpy(priv->ht40_1s_tx_power_index_A,
efuse->ht40_1s_tx_power_index_A, efuse->ht40_1s_tx_power_index_A,
sizeof(priv->ht40_1s_tx_power_index_A)); sizeof(efuse->ht40_1s_tx_power_index_A));
memcpy(priv->ht40_1s_tx_power_index_B, memcpy(priv->ht40_1s_tx_power_index_B,
efuse->ht40_1s_tx_power_index_B, efuse->ht40_1s_tx_power_index_B,
sizeof(priv->ht40_1s_tx_power_index_B)); sizeof(efuse->ht40_1s_tx_power_index_B));
memcpy(priv->ht20_tx_power_index_diff, memcpy(priv->ht20_tx_power_index_diff,
efuse->ht20_tx_power_index_diff, efuse->ht20_tx_power_index_diff,
sizeof(priv->ht20_tx_power_index_diff)); sizeof(efuse->ht20_tx_power_index_diff));
memcpy(priv->ofdm_tx_power_index_diff, memcpy(priv->ofdm_tx_power_index_diff,
efuse->ofdm_tx_power_index_diff, efuse->ofdm_tx_power_index_diff,
sizeof(priv->ofdm_tx_power_index_diff)); sizeof(efuse->ofdm_tx_power_index_diff));
memcpy(priv->ht40_max_power_offset, memcpy(priv->ht40_max_power_offset,
efuse->ht40_max_power_offset, efuse->ht40_max_power_offset,
sizeof(priv->ht40_max_power_offset)); sizeof(efuse->ht40_max_power_offset));
memcpy(priv->ht20_max_power_offset, memcpy(priv->ht20_max_power_offset,
efuse->ht20_max_power_offset, efuse->ht20_max_power_offset,
sizeof(priv->ht20_max_power_offset)); sizeof(efuse->ht20_max_power_offset));
if (priv->efuse_wifi.efuse8723.version >= 0x01) { if (priv->efuse_wifi.efuse8723.version >= 0x01) {
priv->has_xtalk = 1; priv->has_xtalk = 1;
...@@ -2403,34 +2403,34 @@ static int rtl8192cu_parse_efuse(struct rtl8xxxu_priv *priv) ...@@ -2403,34 +2403,34 @@ static int rtl8192cu_parse_efuse(struct rtl8xxxu_priv *priv)
memcpy(priv->cck_tx_power_index_A, memcpy(priv->cck_tx_power_index_A,
efuse->cck_tx_power_index_A, efuse->cck_tx_power_index_A,
sizeof(priv->cck_tx_power_index_A)); sizeof(efuse->cck_tx_power_index_A));
memcpy(priv->cck_tx_power_index_B, memcpy(priv->cck_tx_power_index_B,
efuse->cck_tx_power_index_B, efuse->cck_tx_power_index_B,
sizeof(priv->cck_tx_power_index_B)); sizeof(efuse->cck_tx_power_index_B));
memcpy(priv->ht40_1s_tx_power_index_A, memcpy(priv->ht40_1s_tx_power_index_A,
efuse->ht40_1s_tx_power_index_A, efuse->ht40_1s_tx_power_index_A,
sizeof(priv->ht40_1s_tx_power_index_A)); sizeof(efuse->ht40_1s_tx_power_index_A));
memcpy(priv->ht40_1s_tx_power_index_B, memcpy(priv->ht40_1s_tx_power_index_B,
efuse->ht40_1s_tx_power_index_B, efuse->ht40_1s_tx_power_index_B,
sizeof(priv->ht40_1s_tx_power_index_B)); sizeof(efuse->ht40_1s_tx_power_index_B));
memcpy(priv->ht40_2s_tx_power_index_diff, memcpy(priv->ht40_2s_tx_power_index_diff,
efuse->ht40_2s_tx_power_index_diff, efuse->ht40_2s_tx_power_index_diff,
sizeof(priv->ht40_2s_tx_power_index_diff)); sizeof(efuse->ht40_2s_tx_power_index_diff));
memcpy(priv->ht20_tx_power_index_diff, memcpy(priv->ht20_tx_power_index_diff,
efuse->ht20_tx_power_index_diff, efuse->ht20_tx_power_index_diff,
sizeof(priv->ht20_tx_power_index_diff)); sizeof(efuse->ht20_tx_power_index_diff));
memcpy(priv->ofdm_tx_power_index_diff, memcpy(priv->ofdm_tx_power_index_diff,
efuse->ofdm_tx_power_index_diff, efuse->ofdm_tx_power_index_diff,
sizeof(priv->ofdm_tx_power_index_diff)); sizeof(efuse->ofdm_tx_power_index_diff));
memcpy(priv->ht40_max_power_offset, memcpy(priv->ht40_max_power_offset,
efuse->ht40_max_power_offset, efuse->ht40_max_power_offset,
sizeof(priv->ht40_max_power_offset)); sizeof(efuse->ht40_max_power_offset));
memcpy(priv->ht20_max_power_offset, memcpy(priv->ht20_max_power_offset,
efuse->ht20_max_power_offset, efuse->ht20_max_power_offset,
sizeof(priv->ht20_max_power_offset)); sizeof(efuse->ht20_max_power_offset));
dev_info(&priv->udev->dev, "Vendor: %.7s\n", dev_info(&priv->udev->dev, "Vendor: %.7s\n",
efuse->vendor_name); efuse->vendor_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment