OSDN Git Service

phy: qcom-ufs: Catch devm_phy_create failure in ufs_qcom_phy_generic_probe
authorAxel Lin <axel.lin@ingics.com>
Tue, 3 Mar 2015 01:05:55 +0000 (09:05 +0800)
committerKishon Vijay Abraham I <kishon@ti.com>
Wed, 25 Mar 2015 23:36:09 +0000 (05:06 +0530)
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.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-qcom-ufs.c

index 44ee983..d95effe 100644 (file)
@@ -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;
        }