drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy
PATCH 1/1 drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy
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 e00012b256d4 ("drm/msm/hdmi: Make HDMI core get its PHY")
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/gpu/drm/msm/hdmi/hdmi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/hdmi/hdmi.c +6 -1
@@ -95,10 +95,15 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi)of_node_put (phy_node); -if (!phy_pdev || !hdmi->phy) { +if (!phy_pdev) {DRM_DEV_ERROR (&pdev->dev,"phy driver is not ready\n" );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);
Signature · 1 line
2.17.1
Quoted 6 lines · Miaoqian Lin
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 e00012b256d4 ("drm/msm/hdmi: Make HDMI core get its PHY")Signed-off-by Miaoqian Lin <[email protected]>
Reviewed-by Dmitry Baryshkov <[email protected]>
Quoted 25 lines
--- drivers/gpu/drm/msm/hdmi/hdmi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/gpu/drm/msm/hdmi/hdmi.c +6
-1@@ -95,10 +95,15 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi)of_node_put (phy_node); -if (!phy_pdev || !hdmi->phy) { +if (!phy_pdev) {DRM_DEV_ERROR (&pdev->dev,"phy driver is not ready\n" );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);
Signature · 2 lines
With best wishes Dmitry