[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240821131042.1464529-1-make24@iscas.ac.cn>
Date: Wed, 21 Aug 2024 21:10:42 +0800
From: Ma Ke <make24@...as.ac.cn>
To: vkoul@...nel.org,
kishon@...nel.org,
make24@...as.ac.cn,
agross@...eaurora.org,
ansuelsmth@...il.com
Cc: linux-arm-msm@...r.kernel.org,
linux-phy@...ts.infradead.org,
linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: [PATCH] phy: qualcomm: Check NULL ptr on lvts_data in qcom_ipq806x_usb_phy_probe()
of_device_get_match_data() can return NULL if of_match_device failed, and
the pointer 'data' was dereferenced without checking against NULL. Add
checking of pointer 'data' in qcom_ipq806x_usb_phy_probe().
Cc: stable@...r.kernel.org
Fixes: ef19b117b834 ("phy: qualcomm: add qcom ipq806x dwc usb phy driver")
Signed-off-by: Ma Ke <make24@...as.ac.cn>
---
drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
index 06392ed7c91b..9b9fd9c1b1f7 100644
--- a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
@@ -492,6 +492,8 @@ static int qcom_ipq806x_usb_phy_probe(struct platform_device *pdev)
return -ENOMEM;
data = of_device_get_match_data(&pdev->dev);
+ if (!data)
+ return -ENODEV;
phy_dwc3->dev = &pdev->dev;
--
2.25.1
Powered by blists - more mailing lists