Skip to content

Commit 6baa452

Browse files
Chen NiJiri Kosina
authored andcommitted
HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors
Add a check for the return value of pci_alloc_irq_vectors() and return error if it fails. [[email protected]: reworded changelog based on Srinivas' suggestion] Fixes: 74fbc7d ("HID: intel-ish-hid: add MSI interrupt support") Signed-off-by: Chen Ni <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent b88ee22 commit 6baa452

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/hid/intel-ish-hid/ipc/pci-ish.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
173173

174174
/* request and enable interrupt */
175175
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
176+
if (ret < 0) {
177+
dev_err(dev, "ISH: Failed to allocate IRQ vectors\n");
178+
return ret;
179+
}
180+
176181
if (!pdev->msi_enabled && !pdev->msix_enabled)
177182
irq_flag = IRQF_SHARED;
178183

0 commit comments

Comments
 (0)