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] [day] [month] [year] [list]
Message-ID: <ec88f0a0-12ee-4c16-bb0a-fb572d6e020b@oracle.com>
Date: Tue, 14 Oct 2025 15:50:47 +0530
From: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
To: Sunil Goutham <sgoutham@...vell.com>, Linu Cherian
 <lcherian@...vell.com>,
        Geetha sowjanya <gakula@...vell.com>, Jerin Jacob <jerinj@...vell.com>,
        hariprasad <hkelam@...vell.com>,
        Subbaraya Sundeep <sbhatta@...vell.com>,
        Andrew Lunn
 <andrew+netdev@...n.ch>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Nithya Mani <nmani@...vell.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: dan.carpenter@...aro.org, kernel-janitors@...r.kernel.org,
        error27@...il.com
Subject: Re: [PATCH] Octeontx2-af: Fix pci_alloc_irq_vectors() return value
 check

Hi,

On 14/10/25 15:44, Harshit Mogalapalli wrote:
> In cgx_probe() when pci_alloc_irq_vectors() fails the error value will
> be negative and that check is sufficient.
> 
> 	err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSIX);
>          if (err < 0 || err != nvec) {
>          	...
> 	}
> 
> Remove the check which compares err with nvec.
> 
> Fixes: 1463f382f58d ("octeontx2-af: Add support for CGX link management")
> Suggested-by: Paolo Abeni <pabeni@...hat.com>
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
> ---
> Only compile tested.
> ---
>   drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> index d374a4454836..f4d5a3c05fa4 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> @@ -1993,7 +1993,7 @@ static int cgx_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>   
>   	nvec = pci_msix_vec_count(cgx->pdev);
>   	err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSIX);
> -	if (err < 0 || err != nvec) {
> +	if (err < 0) {
>   		dev_err(dev, "Request for %d msix vectors failed, err %d\n",
>   			nvec, err);


Now that I think about it more, maybe we want to error out when err != 
nvec as well ? In that case maybe the right thing to do is leave the 
check as is and set err = -EXYZ before goto ?

Thanks,
Harshit>   		goto err_release_regions;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ