aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Ni <nichen@iscas.ac.cn>2024-04-29 16:54:22 +0800
committerJiri Kosina <jkosina@suse.com>2024-05-06 23:55:23 +0200
commit6baa4524027fd64d7ca524e1717c88c91a354b93 (patch)
tree68b72be6d491c61017f95a5f6e1783e40f1eaa9a
parentb88ee22809eb7fc9e196c24f43077cd7783eed9b (diff)
downloadhid-for-6.9/upstream-fixes.tar.gz
HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectorsfor-6.9/upstream-fixes
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: 74fbc7d371d9 ("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>
-rw-r--r--drivers/hid/intel-ish-hid/ipc/pci-ish.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
index 56bd4f02f3191..4b8232360cc46 100644
--- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
+++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
@@ -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;