linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/9] usb: dwc3: qcom: add IRQ check
       [not found] <717ddd7c-22cd-d82c-e43d-80254718c801@omp.ru>
@ 2021-08-08 20:41 ` Sergey Shtylyov
  2021-08-09 10:07   ` Felipe Balbi
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Shtylyov @ 2021-08-08 20:41 UTC (permalink / raw)
  To: linux-usb, Greg Kroah-Hartman, Felipe Balbi
  Cc: Andy Gross, Bjorn Andersson, linux-arm-msm

In dwc3_qcom_acpi_register_core(), the driver neglects to check the result
of platform_get_irq()'s call and blithely assigns the negative error codes
to the allocated child device's IRQ resource and then passing this resource
to platform_device_add_resources() and later causing dwc3_otg_get_irq() to
fail anyway.  Stop calling platform_device_add_resources() with the invalid
IRQ #s, so that there's less complexity in the IRQ error checking.

Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

---
 drivers/usb/dwc3/dwc3-qcom.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: usb/drivers/usb/dwc3/dwc3-qcom.c
===================================================================
--- usb.orig/drivers/usb/dwc3/dwc3-qcom.c
+++ usb/drivers/usb/dwc3/dwc3-qcom.c
@@ -614,6 +614,10 @@ static int dwc3_qcom_acpi_register_core(
 		qcom->acpi_pdata->dwc3_core_base_size;
 
 	irq = platform_get_irq(pdev_irq, 0);
+	if (irq < 0) {
+		ret = irq;
+		goto out;
+	}
 	child_res[1].flags = IORESOURCE_IRQ;
 	child_res[1].start = child_res[1].end = irq;
 

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

* Re: [PATCH 2/9] usb: dwc3: qcom: add IRQ check
  2021-08-08 20:41 ` [PATCH 2/9] usb: dwc3: qcom: add IRQ check Sergey Shtylyov
@ 2021-08-09 10:07   ` Felipe Balbi
  0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2021-08-09 10:07 UTC (permalink / raw)
  To: Sergey Shtylyov
  Cc: linux-usb, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
	linux-arm-msm


Sergey Shtylyov <s.shtylyov@omp.ru> writes:

> In dwc3_qcom_acpi_register_core(), the driver neglects to check the result
> of platform_get_irq()'s call and blithely assigns the negative error codes
> to the allocated child device's IRQ resource and then passing this resource
> to platform_device_add_resources() and later causing dwc3_otg_get_irq() to
> fail anyway.  Stop calling platform_device_add_resources() with the invalid
> IRQ #s, so that there's less complexity in the IRQ error checking.
>
> Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

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

end of thread, other threads:[~2021-08-09 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <717ddd7c-22cd-d82c-e43d-80254718c801@omp.ru>
2021-08-08 20:41 ` [PATCH 2/9] usb: dwc3: qcom: add IRQ check Sergey Shtylyov
2021-08-09 10:07   ` Felipe Balbi

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