All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: "Colin King" <colin.king@canonical.com>,
	"Kalle Valo" <kvalo@codeaurora.org>,
	"David S . Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"John W . Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org,
	netdev@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] b43: N-PHY: Fix the update of coef for the PHY revision >= 3case
Date: Mon, 15 Feb 2021 09:58:41 -0600	[thread overview]
Message-ID: <a1f578d8-bfaf-ec92-7874-84a586385495@lwfinger.net> (raw)
In-Reply-To: <20210215120532.76889-1-colin.king@canonical.com>

On 2/15/21 6:05 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>
> ---
>   drivers/net/wireless/broadcom/b43/phy_n.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/broadcom/b43/phy_n.c b/drivers/net/wireless/broadcom/b43/phy_n.c
> index b669dff24b6e..665b737fbb0d 100644
> --- a/drivers/net/wireless/broadcom/b43/phy_n.c
> +++ b/drivers/net/wireless/broadcom/b43/phy_n.c
> @@ -5311,7 +5311,7 @@ static void b43_nphy_restore_cal(struct b43_wldev *dev)
>   
>   	for (i = 0; i < 4; i++) {
>   		if (dev->phy.rev >= 3)
> -			table[i] = coef[i];
> +			coef[i] = table[i];
>   		else
>   			coef[i] = 0;
>   	}
> 

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Good catch, thanks.

Larry


WARNING: multiple messages have this Message-ID (diff)
From: Larry Finger <Larry.Finger@lwfinger.net>
To: "Colin King" <colin.king@canonical.com>,
	"Kalle Valo" <kvalo@codeaurora.org>,
	"David S . Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"John W . Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org,
	netdev@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] b43: N-PHY: Fix the update of coef for the PHY revision >= 3case
Date: Mon, 15 Feb 2021 15:58:41 +0000	[thread overview]
Message-ID: <a1f578d8-bfaf-ec92-7874-84a586385495@lwfinger.net> (raw)
In-Reply-To: <20210215120532.76889-1-colin.king@canonical.com>

On 2/15/21 6:05 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>
> ---
>   drivers/net/wireless/broadcom/b43/phy_n.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/broadcom/b43/phy_n.c b/drivers/net/wireless/broadcom/b43/phy_n.c
> index b669dff24b6e..665b737fbb0d 100644
> --- a/drivers/net/wireless/broadcom/b43/phy_n.c
> +++ b/drivers/net/wireless/broadcom/b43/phy_n.c
> @@ -5311,7 +5311,7 @@ static void b43_nphy_restore_cal(struct b43_wldev *dev)
>   
>   	for (i = 0; i < 4; i++) {
>   		if (dev->phy.rev >= 3)
> -			table[i] = coef[i];
> +			coef[i] = table[i];
>   		else
>   			coef[i] = 0;
>   	}
> 

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Good catch, thanks.

Larry

WARNING: multiple messages have this Message-ID (diff)
From: Larry Finger <Larry.Finger@lwfinger.net>
To: "Colin King" <colin.king@canonical.com>,
	"Kalle Valo" <kvalo@codeaurora.org>,
	"David S . Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"John W . Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org,
	netdev@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] b43: N-PHY: Fix the update of coef for the PHY revision >= 3case
Date: Mon, 15 Feb 2021 09:58:41 -0600	[thread overview]
Message-ID: <a1f578d8-bfaf-ec92-7874-84a586385495@lwfinger.net> (raw)
In-Reply-To: <20210215120532.76889-1-colin.king@canonical.com>

On 2/15/21 6:05 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>
> ---
>   drivers/net/wireless/broadcom/b43/phy_n.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/broadcom/b43/phy_n.c b/drivers/net/wireless/broadcom/b43/phy_n.c
> index b669dff24b6e..665b737fbb0d 100644
> --- a/drivers/net/wireless/broadcom/b43/phy_n.c
> +++ b/drivers/net/wireless/broadcom/b43/phy_n.c
> @@ -5311,7 +5311,7 @@ static void b43_nphy_restore_cal(struct b43_wldev *dev)
>   
>   	for (i = 0; i < 4; i++) {
>   		if (dev->phy.rev >= 3)
> -			table[i] = coef[i];
> +			coef[i] = table[i];
>   		else
>   			coef[i] = 0;
>   	}
> 

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Good catch, thanks.

Larry

  reply	other threads:[~2021-02-15 16:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 12:05 [PATCH] b43: N-PHY: Fix the update of coef for the PHY revision >= 3case Colin King
2021-02-15 15:58 ` Larry Finger [this message]
2021-02-15 15:58   ` Larry Finger
2021-02-15 15:58   ` Larry Finger
2021-02-15 20:50 ` patchwork-bot+netdevbpf
2021-02-15 20:50   ` patchwork-bot+netdevbpf at kernel.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1f578d8-bfaf-ec92-7874-84a586385495@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=b43-dev@lists.infradead.org \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.