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]
Message-ID: <20240911134436.GA628842@bhelgaas>
Date: Wed, 11 Sep 2024 08:44:36 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Qianqiang Liu <qianqiang.liu@....com>
Cc: bcm-kernel-feedback-list@...adcom.com, florian.fainelli@...adcom.com,
	james.quinlan@...adcom.com, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PCI: brcmstb: Fix control flow issue

On Wed, Sep 11, 2024 at 10:50:59AM +0800, Qianqiang Liu wrote:
> The type of "num_inbound_wins" is "u8", so the less-than-zero
> comparison of an unsigned value is never true.

I think this was fixed slightly differently but with the same effect;
please check this to make sure:

https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-brcmstb.c?h=controller/brcmstb#n1034

> ---
>  drivers/pci/controller/pcie-brcmstb.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> index 55311dc47615..3e4572c3eeb1 100644
> --- a/drivers/pci/controller/pcie-brcmstb.c
> +++ b/drivers/pci/controller/pcie-brcmstb.c
> @@ -1090,9 +1090,11 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
>  	u32p_replace_bits(&tmp, 1, PCIE_MISC_MISC_CTRL_PCIE_RCB_64B_MODE_MASK);
>  	writel(tmp, base + PCIE_MISC_MISC_CTRL);
>  
> -	num_inbound_wins = brcm_pcie_get_inbound_wins(pcie, inbound_wins);
> -	if (num_inbound_wins < 0)
> -		return num_inbound_wins;
> +	ret = brcm_pcie_get_inbound_wins(pcie, inbound_wins);
> +	if (ret < 0)
> +		return ret;
> +
> +	num_inbound_wins = (u8)ret;
>  
>  	set_inbound_win_registers(pcie, inbound_wins, num_inbound_wins);
>  
> -- 
> 2.39.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ