Skip to contentSkip to conversation

phy: qcom: m31-eusb2: fix match data santity check

PATCH Applied Johan Hovold 3 participants 3 messages Jun 17, 2025 – Jun 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: qcom: m31-eusb2: fix match data santity check

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 <[email protected]>
Cc Melody Olvera <[email protected]>
---
 drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-m31-eusb2.c +1 -1
index 9b987911fcdb..9ad7af503baa 100644
@@ -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;
 
Signature · 1 line
2.49.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Johan Hovold

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 <[email protected]>
Cc Melody Olvera <[email protected]>
---
  drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-m31-eusb2.c +0 -0
index 9b987911fcdb..9ad7af503baa 100644

drivers/phy/qualcomm/phy-qcom-m31-eusb2.c static int m31eusb2_phy_probe(struct platform_device *pdev) · line 258

Quoted 8 lines
drivers/phy/qualcomm/phy-qcom-m31-eusb2.c +1 -1
@@ -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;
 
maintainer Applied
#2 lore raw
In reply to Johan Hovold
Quoted 4 lines · Johan Hovold

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,

Signature · 1 line
~Vinod