linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors
@ 2024-04-29  8:54 Chen Ni
  2024-05-02 15:23 ` srinivas pandruvada
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Ni @ 2024-04-29  8:54 UTC (permalink / raw)
  To: srinivas.pandruvada, jikos, bentiss, even.xu, lixu.zhang,
	kai.heng.feng, hongyan.song
  Cc: linux-input, linux-kernel, Chen Ni

Add check for the return value of pci_alloc_irq_vectors() and return
the error if it fails in order to catch the error.

Fixes: 74fbc7d371d9 ("HID: intel-ish-hid: add MSI interrupt support")
Signed-off-by: Chen Ni <nichen@iscas.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;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors
  2024-04-29  8:54 [PATCH] HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors Chen Ni
@ 2024-05-02 15:23 ` srinivas pandruvada
  2024-05-06 21:11   ` Jiri Kosina
  0 siblings, 1 reply; 5+ messages in thread
From: srinivas pandruvada @ 2024-05-02 15:23 UTC (permalink / raw)
  To: Chen Ni, jikos, bentiss, even.xu, lixu.zhang, kai.heng.feng,
	hongyan.song
  Cc: linux-input, linux-kernel

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@iscas.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;
>  


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors
  2024-05-02 15:23 ` srinivas pandruvada
@ 2024-05-06 21:11   ` Jiri Kosina
  2024-05-06 21:52     ` srinivas pandruvada
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Kosina @ 2024-05-06 21:11 UTC (permalink / raw)
  To: srinivas pandruvada
  Cc: Chen Ni, bentiss, even.xu, lixu.zhang, kai.heng.feng,
	hongyan.song, linux-input, linux-kernel

On Thu, 2 May 2024, srinivas pandruvada wrote:

> 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.
> "

Srinivas,

my understanding is that with the changelog rewroding this patch has your 
Ack?

Thanks,

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors
  2024-05-06 21:11   ` Jiri Kosina
@ 2024-05-06 21:52     ` srinivas pandruvada
  2024-05-06 21:55       ` Jiri Kosina
  0 siblings, 1 reply; 5+ messages in thread
From: srinivas pandruvada @ 2024-05-06 21:52 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Chen Ni, bentiss, even.xu, lixu.zhang, kai.heng.feng,
	hongyan.song, linux-input, linux-kernel

On Mon, 2024-05-06 at 23:11 +0200, Jiri Kosina wrote:
> On Thu, 2 May 2024, srinivas pandruvada wrote:
> 
> > 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.
> > "
> 
Hi Jiri,

> Srinivas,
> 
> my understanding is that with the changelog rewroding this patch has
> your 
> Ack?
Yes, just to make it more clear. With that.


Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Thanks,
Srinivas


> 
> Thanks,
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors
  2024-05-06 21:52     ` srinivas pandruvada
@ 2024-05-06 21:55       ` Jiri Kosina
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Kosina @ 2024-05-06 21:55 UTC (permalink / raw)
  To: srinivas pandruvada
  Cc: Chen Ni, bentiss, even.xu, lixu.zhang, kai.heng.feng,
	hongyan.song, linux-input, linux-kernel

On Mon, 6 May 2024, srinivas pandruvada wrote:

> > my understanding is that with the changelog rewroding this patch has
> > your 
> > Ack?
> Yes, just to make it more clear. With that.
> 
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Thanks, now applied.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-06 21:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-29  8:54 [PATCH] HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors Chen Ni
2024-05-02 15:23 ` srinivas pandruvada
2024-05-06 21:11   ` Jiri Kosina
2024-05-06 21:52     ` srinivas pandruvada
2024-05-06 21:55       ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).