phy: qcom: m31-eusb2: fix match data santity check
Subsystems (2)
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]>
Signed-off-by Johan Hovold <[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
@@ -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
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]>Signed-off-by Johan Hovold <[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
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;
Reviewed-by Neil Armstrong <[email protected]>
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