]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Octeontx2-af: Fix pci_alloc_irq_vectors() return value check
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Wed, 15 Oct 2025 09:01:17 +0000 (02:01 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Oct 2025 22:47:28 +0000 (15:47 -0700)
commite1048520750dd9369ec97554ab308ff1ff932ec6
tree2f71fc6a9ac9ea1b089174ec44c2d00a54258da8
parent38c31c2620de4e570539a2a461eb62d0e7e692f7
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 <pabeni@redhat.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251015090117.1557870-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/cgx.c