From: Axel Lin <[email protected]>

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 <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
---
 drivers/phy/phy-qcom-ufs.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/phy/phy-qcom-ufs.c b/drivers/phy/phy-qcom-ufs.c
index 44ee983..d95effe 100644
--- a/drivers/phy/phy-qcom-ufs.c
+++ b/drivers/phy/phy-qcom-ufs.c
@@ -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;
        }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to