Skip to content

Commit

Permalink
drm/sun4i: dw-hdmi: Fix missing put_device() call in sun8i_hdmi_phy_get
Browse files Browse the repository at this point in the history
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: 9bf3797 ("drm/sun4i: dw-hdmi: Make HDMI PHY into a platform device")
Signed-off-by: Miaoqian Lin <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
Yuuoniy authored and mripard committed Jan 11, 2022
1 parent 22bf404 commit c71af3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,10 @@ int sun8i_hdmi_phy_get(struct sun8i_dw_hdmi *hdmi, struct device_node *node)
return -EPROBE_DEFER;

phy = platform_get_drvdata(pdev);
if (!phy)
if (!phy) {
put_device(&pdev->dev);
return -EPROBE_DEFER;
}

hdmi->phy = phy;

Expand Down

0 comments on commit c71af3d

Please sign in to comment.