[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220815180410.395878169@linuxfoundation.org>
Date: Mon, 15 Aug 2022 20:06:56 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Miaoqian Lin <linmq006@...il.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Neil Armstrong <narmstrong@...libre.com>
Subject: [PATCH 5.15 772/779] drm/meson: Fix refcount leak in meson_encoder_hdmi_init
From: Miaoqian Lin <linmq006@...il.com>
commit 7381076809586528e2a812a709e2758916318a99 upstream.
of_find_device_by_node() takes reference, we should use put_device()
to release it when not need anymore.
Add missing put_device() in error path to avoid refcount
leak.
Fixes: 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
Reviewed-by: Neil Armstrong <narmstrong@...libre.com>
Signed-off-by: Neil Armstrong <narmstrong@...libre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511054052.51981-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/gpu/drm/meson/meson_encoder_hdmi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
@@ -438,8 +438,10 @@ int meson_encoder_hdmi_init(struct meson
cec_fill_conn_info_from_drm(&conn_info, meson_encoder_hdmi->connector);
notifier = cec_notifier_conn_register(&pdev->dev, NULL, &conn_info);
- if (!notifier)
+ if (!notifier) {
+ put_device(&pdev->dev);
return -ENOMEM;
+ }
meson_encoder_hdmi->cec_notifier = notifier;
}
Powered by blists - more mailing lists