b43: N-PHY: Fix the update of coef for the PHY revision >= 3case
authorColin Ian King <colin.king@canonical.com>
Mon, 15 Feb 2021 12:05:32 +0000 (12:05 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Mar 2021 17:22:40 +0000 (18:22 +0100)
commit4fac507d8f03cf4fc3389952521f46b0cda2b063
treee42282296847aafa9f495e2a85277dc7d61ca271
parent14d12b1b9b5b7a051d46d34053a379982472455b
b43: N-PHY: Fix the update of coef for the PHY revision >= 3case

[ Upstream commit 4773acf3d4b50768bf08e9e97a204819e9ea0895 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/broadcom/b43/phy_n.c