Thread (6 messages) 6 messages, 3 authors, 2021-12-20

Re: [PATCH] usb: dwc3: qcom: Check for null irq pointer

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-12-20 10:44:27
Also in: linux-arm-msm, lkml

On Mon, Dec 20, 2021 at 06:15:20PM +0800, Jiasheng Jiang wrote:
quoted hunk ↗ jump to hunk
The return value of platform_get_irq() needs to be checked.
To avoid use of null pointer in case that there is no irq.

Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI")
Signed-off-by: Jiasheng Jiang <redacted>
---
 drivers/usb/dwc3/dwc3-qcom.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 49e6ca94486d..f04fb3f2fb85 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -614,6 +614,11 @@ static int dwc3_qcom_acpi_register_core(struct platform_device *pdev)
 		qcom->acpi_pdata->dwc3_core_base_size;
 
 	irq = platform_get_irq(pdev_irq, 0);
+	if (!irq) {
+		ret = -EINVAL;
That is NOT the proper way to check the return value of this function
call.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help