From: Neil Armstrong <narmstrong@baylibre.com>
To: Miaoqian Lin <linmq006@gmail.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Sam Ravnborg <sam@ravnborg.org>,
dri-devel@lists.freedesktop.org,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/meson: Fix refcount leak in meson_encoder_hdmi_init
Date: Thu, 12 May 2022 14:20:37 +0200 [thread overview]
Message-ID: <dabe6a15-b0ba-0458-bbd7-a07224071920@baylibre.com> (raw)
In-Reply-To: <20220511054052.51981-1-linmq006@gmail.com>
On 11/05/2022 07:40, Miaoqian Lin wrote:
> 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@gmail.com>
> ---
> drivers/gpu/drm/meson/meson_encoder_hdmi.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> index 5e306de6f485..de87f02cd388 100644
> --- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> +++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> @@ -435,8 +435,10 @@ int meson_encoder_hdmi_init(struct meson_drm *priv)
> 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;
> }
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
next prev parent reply other threads:[~2022-05-12 12:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 5:40 Miaoqian Lin
2022-05-12 12:20 ` Neil Armstrong [this message]
2022-05-12 12:38 ` Martin Blumenstingl
2022-05-12 15:33 ` Neil Armstrong
2022-05-18 7:23 ` Neil Armstrong
2022-05-12 9:21 Miaoqian Lin
2022-05-12 9:32 ` Neil Armstrong
2022-05-12 11:17 ` Miaoqian Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dabe6a15-b0ba-0458-bbd7-a07224071920@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=linmq006@gmail.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome