Skip to content

Commit

Permalink
HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors
Browse files Browse the repository at this point in the history
Add a check for the return value of pci_alloc_irq_vectors() and return
error if it fails.

[jkosina@suse.com: reworded changelog based on Srinivas' suggestion]
Fixes: 74fbc7d ("HID: intel-ish-hid: add MSI interrupt support")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
  • Loading branch information
Chen Ni authored and Jiri Kosina committed May 6, 2024
1 parent b88ee22 commit 6baa452
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/hid/intel-ish-hid/ipc/pci-ish.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

/* request and enable interrupt */
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
if (ret < 0) {
dev_err(dev, "ISH: Failed to allocate IRQ vectors\n");
return ret;
}

if (!pdev->msi_enabled && !pdev->msix_enabled)
irq_flag = IRQF_SHARED;

Expand Down

0 comments on commit 6baa452

Please sign in to comment.