drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The device_get_match_data() helper returns NULL if a new entry is ever
added without corresponding match data.
Fixes: 9c8504861cc4 ("phy: qcom: Add M31 based eUSB2 PHY driver")
Cc: Wesley Cheng <quic_wcheng@quicinc.com>
Cc: Melody Olvera <melody.olvera@oss.qualcomm.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
index 9b987911fcdb..9ad7af503baa 100644
--- a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
+++ b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
@@ -252,7 +252,7 @@ static int m31eusb2_phy_probe(struct platform_device *pdev)
return -ENOMEM;
data = device_get_match_data(dev);
- if (IS_ERR(data))
+ if (!data)
return -EINVAL;
phy->data = data;
--
2.49.0
On Tue, 17 Jun 2025 10:05:03 +0200, Johan Hovold wrote:
> The device_get_match_data() helper returns NULL if a new entry is ever
> added without corresponding match data.
>
>
Applied, thanks!
[1/1] phy: qcom: m31-eusb2: fix match data santity check
commit: 603bd9808f58009e1f230271f94e1b9e13d506ba
Best regards,
--
~Vinod
On 17/06/2025 10:05, Johan Hovold wrote:
> The device_get_match_data() helper returns NULL if a new entry is ever
> added without corresponding match data.
>
> Fixes: 9c8504861cc4 ("phy: qcom: Add M31 based eUSB2 PHY driver")
> Cc: Wesley Cheng <quic_wcheng@quicinc.com>
> Cc: Melody Olvera <melody.olvera@oss.qualcomm.com>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
> drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
> index 9b987911fcdb..9ad7af503baa 100644
> --- a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
> +++ b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
> @@ -252,7 +252,7 @@ static int m31eusb2_phy_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> data = device_get_match_data(dev);
> - if (IS_ERR(data))
> + if (!data)
> return -EINVAL;
> phy->data = data;
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
© 2016 - 2026 Red Hat, Inc.