mirror of
https://github.com/torvalds/linux.git
synced 2024-11-30 16:11:38 +00:00
crypto: nitrox - fix unchecked variable in nitrox_register_interrupts
Function nitrox_register_interrupts leaves variable 'nr_vecs' unchecked, which
would be use as kcalloc parameter later.
Fixes: 5155e118dd
("crypto: cavium/nitrox - use pci_alloc_irq_vectors() while enabling MSI-X.")
Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
760fe22cf5
commit
57c126661f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user