]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/meson: encoder_cvbs: Fix refcount leak in meson_encoder_cvbs_init
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 1 Jun 2022 03:39:26 +0000 (07:39 +0400)
committerNeil Armstrong <narmstrong@baylibre.com>
Tue, 7 Jun 2022 12:25:16 +0000 (14:25 +0200)
of_graph_get_remote_node() returns remote device nodepointer with
refcount incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.

Fixes: 5d4774fcb39f ("drm/meson: encoder_cvbs: switch to bridge with ATTACH_NO_CONNECTOR")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220601033927.47814-2-linmq006@gmail.com
drivers/gpu/drm/meson/meson_encoder_cvbs.c

index fd8db97ba8ba277f6804e19172c8f6c8ec794be8..8110a6e39320f7190b3cf2c14b496d39f6f96e2f 100644 (file)
@@ -238,6 +238,7 @@ int meson_encoder_cvbs_init(struct meson_drm *priv)
        }
 
        meson_encoder_cvbs->next_bridge = of_drm_find_bridge(remote);
+       of_node_put(remote);
        if (!meson_encoder_cvbs->next_bridge) {
                dev_err(priv->dev, "Failed to find CVBS Connector bridge\n");
                return -EPROBE_DEFER;