Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

b43: N-PHY: Fix the update of coef for the PHY revision >= 3case

The documentation for the PHY update [1] states:

Loop 4 times with index i

If PHY Revision >= 3
Copy table[i] to coef[i]
Otherwise
Set coef[i] to 0

the copy of the table to coef is currently implemented the wrong way
around, table is being updated from uninitialized values in coeff.
Fix this by swapping the assignment around.

[1] https://bcm-v4.sipsolutions.net/802.11/PHY/N/RestoreCal/

Fixes: 2f258b74d13c ("b43: N-PHY: implement restoring general configuration")
Addresses-Coverity: ("Uninitialized scalar variable")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Colin Ian King and committed by
David S. Miller
4773acf3 2355a677

+1 -1
+1 -1
drivers/net/wireless/broadcom/b43/phy_n.c
··· 5311 5311 5312 5312 for (i = 0; i < 4; i++) { 5313 5313 if (dev->phy.rev >= 3) 5314 - table[i] = coef[i]; 5314 + coef[i] = table[i]; 5315 5315 else 5316 5316 coef[i] = 0; 5317 5317 }