mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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>
This commit is contained in:
committed by
Jakub Kicinski
parent
38c31c2620
commit
e104852075
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user