netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] iwlwifi: mvm: fix comparison of u32 variable with less than zero
@ 2019-07-01 16:26 Colin King
  2019-07-02 11:54 ` Luca Coelho
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-07-01 16:26 UTC (permalink / raw)
  To: Haim Dreyfuss, Johannes Berg, Emmanuel Grumbach, Luca Coelho,
	Intel Linux Wireless, Kalle Valo, David S . Miller,
	linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The comparison of the u32 variable wgds_tbl_idx with less than zero is
always going to be false because it is unsigned.  Fix this by making
wgds_tbl_idx a plain signed int.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 4fd445a2c855 ("iwlwifi: mvm: Add log information about SAR status")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
index 719f793b3487..a9bb43a2f27b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
@@ -620,7 +620,7 @@ void iwl_mvm_rx_chub_update_mcc(struct iwl_mvm *mvm,
 	enum iwl_mcc_source src;
 	char mcc[3];
 	struct ieee80211_regdomain *regd;
-	u32 wgds_tbl_idx;
+	int wgds_tbl_idx;
 
 	lockdep_assert_held(&mvm->mutex);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] iwlwifi: mvm: fix comparison of u32 variable with less than zero
  2019-07-01 16:26 [PATCH][next] iwlwifi: mvm: fix comparison of u32 variable with less than zero Colin King
@ 2019-07-02 11:54 ` Luca Coelho
  0 siblings, 0 replies; 2+ messages in thread
From: Luca Coelho @ 2019-07-02 11:54 UTC (permalink / raw)
  To: Colin King, Haim Dreyfuss, Johannes Berg, Emmanuel Grumbach,
	Intel Linux Wireless, Kalle Valo, David S . Miller,
	linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

On Mon, 2019-07-01 at 17:26 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The comparison of the u32 variable wgds_tbl_idx with less than zero is
> always going to be false because it is unsigned.  Fix this by making
> wgds_tbl_idx a plain signed int.
> 
> Addresses-Coverity: ("Unsigned compared against 0")
> Fixes: 4fd445a2c855 ("iwlwifi: mvm: Add log information about SAR status")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
> index 719f793b3487..a9bb43a2f27b 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
> @@ -620,7 +620,7 @@ void iwl_mvm_rx_chub_update_mcc(struct iwl_mvm *mvm,
>  	enum iwl_mcc_source src;
>  	char mcc[3];
>  	struct ieee80211_regdomain *regd;
> -	u32 wgds_tbl_idx;
> +	int wgds_tbl_idx;
>  
>  	lockdep_assert_held(&mvm->mutex);

Thanks, Colin!

I applied this to our internal tree and it will reach the mainline
following our normal upstreaming process.

--
Cheers,
Luca.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-02 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-01 16:26 [PATCH][next] iwlwifi: mvm: fix comparison of u32 variable with less than zero Colin King
2019-07-02 11:54 ` Luca Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).