Skip to content

Commit 774fe0c

Browse files
Yuuoniylumag
authored andcommitted
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: e00012b ("drm/msm/hdmi: Make HDMI core get its PHY") Signed-off-by: Miaoqian Lin <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent c04c314 commit 774fe0c

File tree

1 file changed

+6
-1
lines changed
  • drivers/gpu/drm/msm/hdmi

1 file changed

+6
-1
lines changed

drivers/gpu/drm/msm/hdmi/hdmi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,15 @@ static int msm_hdmi_get_phy(struct hdmi *hdmi)
9797

9898
of_node_put(phy_node);
9999

100-
if (!phy_pdev || !hdmi->phy) {
100+
if (!phy_pdev) {
101101
DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n");
102102
return -EPROBE_DEFER;
103103
}
104+
if (!hdmi->phy) {
105+
DRM_DEV_ERROR(&pdev->dev, "phy driver is not ready\n");
106+
put_device(&phy_pdev->dev);
107+
return -EPROBE_DEFER;
108+
}
104109

105110
hdmi->phy_dev = get_device(&phy_pdev->dev);
106111

0 commit comments

Comments
 (0)