Search Linux Wireless

Re: [PATCH 08/15] wifi: iwlwifi: mvm: Add NULL check before dereferencing the pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2023-06-12 at 18:51 +0300, gregory.greenman@xxxxxxxxx wrote:
> From: Mukesh Sisodiya <mukesh.sisodiya@xxxxxxxxx>
> 
> The p2p, bss and ap vif pointers are assigned based on the mode.
> All pointers will not have valid value at same time and can be
> NULL, based on configured mode. This can lead to NULL pointer
> access.

This is not true.

>  	/* enable PM on bss if bss stand alone */
> -	if (vifs->bss_active && !vifs->p2p_active && !vifs->ap_active) {
> +	if (bss_mvmvif && vifs->bss_active && !vifs->p2p_active &&
> +	    !vifs->ap_active) {
> 

The pointers can only be NULL iff *_active is false, however, it may be
false even if the pointer is non-NULL, so it's not exactly the same.

Probably a static checker thing that didn't understand it?

johannes




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux