From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: <linux-usb@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Felipe Balbi <balbi@kernel.org>
Cc: Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
<linux-arm-msm@vger.kernel.org>
Subject: [PATCH 2/9] usb: dwc3: qcom: add IRQ check
Date: Sun, 8 Aug 2021 23:41:50 +0300 [thread overview]
Message-ID: <563b7c97-4668-3fd4-310b-0a067e805635@omp.ru> (raw)
In-Reply-To: <717ddd7c-22cd-d82c-e43d-80254718c801@omp.ru>
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;
next prev parent reply other threads:[~2021-08-08 20:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-08 20:30 [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers Sergey Shtylyov
2021-08-08 20:37 ` [PATCH 1/9] usb: dwc3: meson-g12a: add IRQ check Sergey Shtylyov
2021-08-08 20:50 ` Martin Blumenstingl
2021-08-09 10:08 ` Felipe Balbi
2021-08-08 20:41 ` Sergey Shtylyov [this message]
2021-08-09 10:07 ` [PATCH 2/9] usb: dwc3: qcom: " Felipe Balbi
2021-08-08 20:45 ` [PATCH 3/9] usb: gadget: udc: at91: " Sergey Shtylyov
2021-08-09 10:07 ` Felipe Balbi
2021-08-08 20:57 ` [PATCH 4/9] usb: gadget: udc: s3c2410: " Sergey Shtylyov
2021-08-08 21:01 ` Sergey Shtylyov
2021-08-09 10:09 ` Felipe Balbi
2021-08-13 6:58 ` [PATCH v2 0/9] Stop calling devm_request_irq() with invalid IRQs in the USB drivers Greg Kroah-Hartman
2021-08-13 7:01 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=563b7c97-4668-3fd4-310b-0a067e805635@omp.ru \
--to=s.shtylyov@omp.ru \
--cc=agross@kernel.org \
--cc=balbi@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).