From: Miaoqian Lin <linmq006@gmail.com>
To: Neil Armstrong <narmstrong@baylibre.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 19:17:00 +0800 [thread overview]
Message-ID: <e778d50a-81c6-6dfa-a58b-73cda452f4e3@gmail.com> (raw)
In-Reply-To: <a811a26e-ec34-f9ce-589f-82e96a975594@baylibre.com>
Hi,
On 2022/5/12 17:32, Neil Armstrong wrote:
> Hi,
>
> On 12/05/2022 11:21, Miaoqian Lin wrote:
>> of_find_device_by_node() takes a reference to the embedded struct device,
>> 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>
>
> You already sent the same patch yesterday, please avoid this.
>
Sorry for the mistake, I realized this after I sent it. I will be more careful.
> Neil
>
>> ---
>> 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;
>> }
>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2022-05-12 11:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 9:21 [PATCH] drm/meson: Fix refcount leak in meson_encoder_hdmi_init Miaoqian Lin
2022-05-12 9:32 ` Neil Armstrong
2022-05-12 11:17 ` Miaoqian Lin [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-05-11 5:40 Miaoqian Lin
2022-05-12 12:20 ` Neil Armstrong
2022-05-12 12:38 ` Martin Blumenstingl
2022-05-12 15:33 ` Neil Armstrong
2022-05-18 7:23 ` Neil Armstrong
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=e778d50a-81c6-6dfa-a58b-73cda452f4e3@gmail.com \
--to=linmq006@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.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=narmstrong@baylibre.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;
as well as URLs for NNTP newsgroup(s).