[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95fadbf4772d575bff777ddb738cb6c25b85b779.camel@linux.intel.com>
Date: Thu, 02 May 2024 08:23:51 -0700
From: srinivas pandruvada <srinivas.pandruvada@...ux.intel.com>
To: Chen Ni <nichen@...as.ac.cn>, jikos@...nel.org, bentiss@...nel.org,
even.xu@...el.com, lixu.zhang@...el.com, kai.heng.feng@...onical.com,
hongyan.song@...el.com
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: intel-ish-hid: ipc: Add check for
pci_alloc_irq_vectors
On Mon, 2024-04-29 at 16:54 +0800, Chen Ni wrote:
> Add check for the return value of pci_alloc_irq_vectors() and return
> the error if it fails in order to catch the error.
>
You can write as
"
Add a check for the return value of pci_alloc_irq_vectors() and return
error if it fails.
"
Thanks,
Srinivas
> Fixes: 74fbc7d371d9 ("HID: intel-ish-hid: add MSI interrupt support")
> Signed-off-by: Chen Ni <nichen@...as.ac.cn>
> ---
> drivers/hid/intel-ish-hid/ipc/pci-ish.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> index e79d72f7db2a..9b9bc58f0524 100644
> --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
> @@ -174,6 +174,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;
>
Powered by blists - more mailing lists