提交 ea116b17 编写于 作者: M Miaoqian Lin 提交者: Zheng Zengkai

drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy

stable inclusion
from stable-v5.10.96
commit 0b7d8db87d0bc7af1c27aa62780c2921d69e834a
bugzilla: https://gitee.com/openeuler/kernel/issues/I55NWB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0b7d8db87d0bc7af1c27aa62780c2921d69e834a

--------------------------------

[ Upstream commit 774fe0cd ]

The reference taken by 'of_find_device_by_node()' must be released when
not needed anymore.
Add the corresponding 'put_device()' in the error handling path.

Fixes: e00012b2 ("drm/msm/hdmi: Make HDMI core get its PHY")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Reviewed-by: NDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20220107085026.23831-1-linmq006@gmail.comSigned-off-by: NDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 cf11f5bd
...@@ -97,10 +97,15 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi) ...@@ -97,10 +97,15 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi)
of_node_put(phy_node); of_node_put(phy_node);
if (!phy_pdev || !hdmi->phy) { if (!phy_pdev) {
DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n"); DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n");
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
if (!hdmi->phy) {
DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n");
put_device(&phy_pdev->dev);
return -EPROBE_DEFER;
}
hdmi->phy_dev = get_device(&phy_pdev->dev); hdmi->phy_dev = get_device(&phy_pdev->dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册