From: sashiko-bot@kernel.org
To: "Guangshuo Li" <liguangshuo@mail.sdu.edu.cn>
Cc: linux-clk@vger.kernel.org
Subject: Re: [PATCH 1/2] clk: qcom: kpss-xcc: Fix potential use-after-free on unbind
Date: Sun, 29 Nov 2026 16:34:27 +0000 [thread overview]
Message-ID: <sashiko-outbox-239796@kernel.org> (raw)
In-Reply-To: <20261130-7242f82796-u09-1@mail.sdu.edu.cn>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] clk: qcom: kpss-xcc: prefer devm_of_clk_add_hw_provider() over
manual .remove
--
commit 1a6b29b537b5fcd215d2bf131f69a050eb457d4d
Author: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
clk: qcom: kpss-xcc: Fix potential use-after-free on unbind
This commit adds a platform driver remove callback to unregister the OF
clock provider when the kpss-xcc device is unbound.
> diff --git a/drivers/clk/qcom/kpss-xcc.c b/drivers/clk/qcom/kpss-xcc.c
> index 97bfb21a5e5ea..568a290551dbc 100644
> --- a/drivers/clk/qcom/kpss-xcc.c
> +++ b/drivers/clk/qcom/kpss-xcc.c
> @@ -60,8 +60,14 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev)
> return of_clk_add_hw_provider(dev->of_node, of_clk_hw_simple_get, hw);
> }
>
> +static void kpss_xcc_driver_remove(struct platform_device *pdev)
> +{
> + of_clk_del_provider(pdev->dev.of_node);
> +}
> +
> static struct platform_driver kpss_xcc_driver = {
> .probe = kpss_xcc_driver_probe,
> + .remove = kpss_xcc_driver_remove,
> .driver = {
> .name = "kpss-xcc",
> .of_match_table = kpss_xcc_match_table,
[Severity: Low]
This isn't a bug, but since kpss_xcc_driver_probe() already manages its
other resources via devres, could it call
devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw) instead of
adding a manual kpss_xcc_driver_remove() callback?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130-7242f82796-u09-0@mail.sdu.edu.cn?part=1
next prev parent reply other threads:[~2026-11-29 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 16:25 [PATCH 0/2] clk: qcom: Remove the KPSS and Krait OF providers on unbind Guangshuo Li
2026-11-29 16:25 ` [PATCH 1/2] clk: qcom: kpss-xcc: Fix potential use-after-free " Guangshuo Li
2026-11-29 16:34 ` sashiko-bot [this message]
2026-11-30 8:13 ` Konrad Dybcio
2026-11-29 16:25 ` [PATCH 2/2] clk: qcom: krait-cc: Remove the OF clock provider " Guangshuo Li
2026-11-30 8:13 ` Konrad Dybcio
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=sashiko-outbox-239796@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=liguangshuo@mail.sdu.edu.cn \
--cc=linux-clk@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.