Re: [PATCH v2] Octeontx2-af: Fix pci_alloc_irq_vectors() return value check
From: Simon Horman
Date: Wed Oct 15 2025 - 12:16:05 EST
On Wed, Oct 15, 2025 at 02:01:17AM -0700, 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) {
> ...
> }
>
> When pci_alloc_irq_vectors() fail to allocate nvec number of vectors,
> -ENOSPC is returned, so it would be safe to remove the check that
> compares err with nvec.
>
> Fixes: 1463f382f58d ("octeontx2-af: Add support for CGX link management")
> Suggested-by: Paolo Abeni <pabeni@xxxxxxxxxx>
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>
> ---
> Only compile tested.
>
> v1->v2: Improve the commit message
Thanks for the update.
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>