author: Tong Tiangen <tongtiangen@huawei.com> 2021-06-01 18:01:55 +0800
committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-07-14 17:06:44 +0200
commit: 46b988b2ce9851f72eff9469917c72066431383e
parent: ba68a06cfcbc4cd8a8068c1236207177559ebf5f
Commit Summary:
Diffstat:
1 file changed, 4 insertions, 0 deletions
diff --git a/drivers/crypto/cavium/nitrox/nitrox_isr.c b/drivers/crypto/cavium/nitrox/nitrox_isr.c
index c288c4b51783..f19e520da6d0 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_isr.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_isr.c
@@ -307,6 +307,10 @@ int nitrox_register_interrupts(struct nitrox_device *ndev)
* Entry 192: NPS_CORE_INT_ACTIVE
*/
nr_vecs = pci_msix_vec_count(pdev);
+ if (nr_vecs < 0) {
+ dev_err(DEV(ndev), "Error in getting vec count %d\n", nr_vecs);
+ return nr_vecs;
+ }
/* Enable MSI-X */
ret = pci_alloc_irq_vectors(pdev, nr_vecs, nr_vecs, PCI_IRQ_MSIX);