lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 16 Nov 2021 22:41:20 -0800
From:   Joe Perches <joe@...ches.com>
To:     cgel.zte@...il.com, luciano.coelho@...el.com
Cc:     kvalo@...eaurora.org, davem@...emloft.net, kuba@...nel.org,
        miriam.rachel.korenblit@...el.com, ye.guojin@....com.cn,
        johannes.berg@...el.com, linux-wireless@...r.kernel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] iwlwifi: rs: fixup the return value type of
 iwl_legacy_rate_to_fw_idx()

On Wed, 2021-11-17 at 06:36 +0000, cgel.zte@...il.com wrote:
> From: Ye Guojin <ye.guojin@....com.cn>
> 
> This was found by coccicheck:
> ./drivers/net/wireless/intel/iwlwifi/fw/rs.c, 147, 10-21, WARNING
> Unsigned expression compared with zero legacy_rate < 0
[]
> diff --git a/drivers/net/wireless/intel/iwlwifi/fw/rs.c b/drivers/net/wireless/intel/iwlwifi/fw/rs.c
[]
> @@ -142,7 +142,7 @@ u32 iwl_new_rate_from_v1(u32 rate_v1)
>  		}
>  	/* if legacy format */
>  	} else {
> -		u32 legacy_rate = iwl_legacy_rate_to_fw_idx(rate_v1);
> +		int legacy_rate = iwl_legacy_rate_to_fw_idx(rate_v1);
>  
>  		WARN_ON(legacy_rate < 0);

Why not just remove the WARN_ON instead?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ