From: Stephen Boyd <sboyd@kernel.org>
To: Fei Shao <fshao@chromium.org>
Cc: Fei Shao <fshao@chromium.org>,
Jerome Brunet <jbrunet@baylibre.com>,
Michael Turquette <mturquette@baylibre.com>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] clk: Fix memory leak in devm_clk_notifier_register()
Date: Tue, 20 Jun 2023 12:03:10 -0700 [thread overview]
Message-ID: <e91019a0ed5f61634fbefca855da1f33.sboyd@kernel.org> (raw)
In-Reply-To: <20230619112253.v2.1.I13f060c10549ef181603e921291bdea95f83033c@changeid>
Quoting Fei Shao (2023-06-18 20:22:53)
> devm_clk_notifier_register() allocates a devres resource for clk
> notifier but didn't register that to the device, so the notifier didn't
> get unregistered on device detach and the allocated resource was leaked.
>
> Fix the issue by registering the resource through devres_add().
>
> Fixes: 6d30d50d037d ("clk: add devm variant of clk_notifier_register")
> Signed-off-by: Fei Shao <fshao@chromium.org>
> ---
Applied to clk-next
It would be nice to also add a test or two for this.
prev parent reply other threads:[~2023-06-20 19:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-19 3:22 [PATCH v2] clk: Fix memory leak in devm_clk_notifier_register() Fei Shao
2023-06-19 8:48 ` Dan Carpenter
2023-06-19 9:05 ` Fei Shao
2023-06-19 9:24 ` Dan Carpenter
2023-06-19 9:38 ` Fei Shao
2023-06-19 9:57 ` Dan Carpenter
2023-06-19 10:34 ` Fei Shao
2023-06-20 19:03 ` Stephen Boyd [this message]
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=e91019a0ed5f61634fbefca855da1f33.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=fshao@chromium.org \
--cc=jbrunet@baylibre.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
/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