drm/sun4i: dw-hdmi: Fix missing put_device() call in sun8i_hdmi_phy_get
authorMiaoqian Lin <linmq006@gmail.com>
Fri, 7 Jan 2022 08:36:32 +0000 (08:36 +0000)
committerMaxime Ripard <maxime@cerno.tech>
Tue, 11 Jan 2022 09:49:32 +0000 (10:49 +0100)
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: 9bf3797796f5 ("drm/sun4i: dw-hdmi: Make HDMI PHY into a platform device")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220107083633.20843-1-linmq006@gmail.com
drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c

index b64d93d..5e2b017 100644 (file)
@@ -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;