From: Sean Paul Date: Mon, 17 Jun 2019 20:09:17 +0000 (-0400) Subject: drm/msm/phy/dsi_phy: Set pll to NULL in case initialization fails X-Git-Tag: v5.15~5873^2~12^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7896e2237d034493036b25fc0c674654eeeb4dfa;p=platform%2Fkernel%2Flinux-starfive.git drm/msm/phy/dsi_phy: Set pll to NULL in case initialization fails We have if (!phy->pll) checks scattered through the driver and if phy->pll is an error pointer, those checks will pass and bad things will happen :( Reviewed-by: Rob Clark Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20190617200920.133104-1-sean@poorly.run --- diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c index fda7374..524d4c4 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c @@ -618,10 +618,12 @@ static int dsi_phy_driver_probe(struct platform_device *pdev) goto fail; phy->pll = msm_dsi_pll_init(pdev, phy->cfg->type, phy->id); - if (IS_ERR_OR_NULL(phy->pll)) + if (IS_ERR_OR_NULL(phy->pll)) { DRM_DEV_INFO(dev, "%s: pll init failed: %ld, need separate pll clk driver\n", __func__, PTR_ERR(phy->pll)); + phy->pll = NULL; + } dsi_phy_disable_resource(phy);