Skip to contentSkip to conversation

phy: qcom-ufs: Catch devm_phy_create failure in ufs_qcom_phy_generic_probe

PATCH In review Axel Lin 2 participants 3 messages Mar 3, 2015 – Mar 17, 2015 Generic PHY framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 phy: qcom-ufs: Catch devm_phy_create failure in ufs_qcom_phy_generic_probe

Current code does NULL test against return value of ufs_qcom_phy_generic_probe. However, in the case of devm_phy_create() failure, ufs_qcom_phy_generic_probe does not return NULL. Fix it.

---
 drivers/phy/phy-qcom-ufs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/phy/phy-qcom-ufs.c +1 -0
index 44ee983..d95effe 100644
@@ -101,6 +101,7 @@ struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
 	if (IS_ERR(generic_phy)) {
 		err =  PTR_ERR(generic_phy);
 		dev_err(dev, "%s: failed to create phy %d\n", __func__, err);
+		generic_phy = NULL;
 		goto out;
 	}
 
Signature · 1 line
1.9.1
author
#1 lore raw

2015-03-03 9:05 GMT+08:00 Axel Lin <[email protected]>:

Quoted 3 lines

Current code does NULL test against return value of ufs_qcom_phy_generic_probe. However, in the case of devm_phy_create() failure, ufs_qcom_phy_generic_probe does not return NULL. Fix it.

Hi Kishon,
Seems this patch is missed.
Should I resend it?
Thanks,
Axel

#2 lore raw
Quoted 7 lines · Axel Lin

2015-03-03 9:05 GMT+08:00 Axel Lin <[email protected]>:

Quoted 3 lines

Current code does NULL test against return value of ufs_qcom_phy_generic_probe. However, in the case of devm_phy_create() failure, ufs_qcom_phy_generic_probe does not return NULL. Fix it.

Hi Kishon,
Seems this patch is missed.
Should I resend it?

not necessary, I have the patch with me.

Thanks
Kishon