[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211203080106.1559983-1-jiasheng@iscas.ac.cn>
Date: Fri, 3 Dec 2021 16:01:06 +0800
From: Jiasheng Jiang <jiasheng@...as.ac.cn>
To: peter.chen@...nel.org, gregkh@...uxfoundation.org,
p.zabel@...gutronix.de
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: [PATCH] usb: chipidea: msm: Handle error codes
The return value of of_get_next_available_child() and
of_device_is_compatible() is not always 0.
To catch the exception in case of the failure.
Fixes: 47654a162081 ("usb: chipidea: msm: Restore wrapper settings after reset")
Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
---
drivers/usb/chipidea/ci_hdrc_msm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
index 46105457e1ca..13218f0a2bed 100644
--- a/drivers/usb/chipidea/ci_hdrc_msm.c
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
@@ -246,6 +246,8 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev)
if (ulpi_node) {
phy_node = of_get_next_available_child(ulpi_node, NULL);
ci->hsic = of_device_is_compatible(phy_node, "qcom,usb-hsic-phy");
+ if (!phy_node || !ci->hsic)
+ goto err_mux;
of_node_put(phy_node);
}
of_node_put(ulpi_node);
--
2.25.1
Powered by blists - more mailing lists