Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <robdclark@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190617200920.133104-1-sean@poorly.run

+3 -1
+3 -1
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
··· 618 618 goto fail; 619 619 620 620 phy->pll = msm_dsi_pll_init(pdev, phy->cfg->type, phy->id); 621 - if (IS_ERR_OR_NULL(phy->pll)) 621 + if (IS_ERR_OR_NULL(phy->pll)) { 622 622 DRM_DEV_INFO(dev, 623 623 "%s: pll init failed: %ld, need separate pll clk driver\n", 624 624 __func__, PTR_ERR(phy->pll)); 625 + phy->pll = NULL; 626 + } 625 627 626 628 dsi_phy_disable_resource(phy); 627 629