From: Harshit Mogalapalli Date: Wed, 15 Oct 2025 09:01:17 +0000 (-0700) Subject: Octeontx2-af: Fix pci_alloc_irq_vectors() return value check X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e1048520750dd9369ec97554ab308ff1ff932ec6;p=thirdparty%2Fkernel%2Flinux.git Octeontx2-af: Fix pci_alloc_irq_vectors() return value check 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. Suggested-by: Paolo Abeni Signed-off-by: Harshit Mogalapalli Reviewed-by: Simon Horman Link: https://patch.msgid.link/20251015090117.1557870-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c index ec0e11c77cbf2..42044cd810b1f 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c @@ -1994,7 +1994,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); goto err_release_regions;