Linux Power Management development
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Tian Xuechen <202300460064@mail.sdu.edu.cn>
Cc: nikita.shubin@maquefel.me, arnd@arndb.de, vkoul@kernel.org,
	 linux@roeck-us.net, alexandre.belloni@bootlin.com, fkan@apm.com,
	 linux-pm@vger.kernel.org, liguangshuo@mail.sdu.edu.cn
Subject: Re: [PATCH 1/4] power: reset: ep93xx: Unregister the restart handler on removal
Date: Sat, 5 Dec 2026 23:57:14 +0100	[thread overview]
Message-ID: <axSWq2R_d3_9djAg@venus> (raw)
In-Reply-To: <20261129094744.1691778-2-202300460064@mail.sdu.edu.cn>

[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]

Hi,

On Sun, Nov 29, 2026 at 05:47:41PM +0800, Tian Xuechen wrote:
> From: Tian Xuechen <202300460064@mail.sdu.edu.cn>
> 
> The restart notifier remains registered after devres releases its
> driver data. Arrange for the device to unregister the notifier
> before that storage goes away.
> 
> This issue was found by our static analysis tool under development.
> 
> Fixes: 9fa7cdb4368f ("power: reset: Add a driver for the ep93xx reset")
> Signed-off-by: Tian Xuechen <202300460064@mail.sdu.edu.cn>
> ---

I queued a different fix, which was sent before this one.

Greetings,

-- Sebastian

>  drivers/power/reset/ep93xx-restart.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/power/reset/ep93xx-restart.c b/drivers/power/reset/ep93xx-restart.c
> index 46415a3071e7..a65c84e4e5a7 100644
> --- a/drivers/power/reset/ep93xx-restart.c
> +++ b/drivers/power/reset/ep93xx-restart.c
> @@ -41,6 +41,11 @@ static int ep93xx_restart_handle(struct notifier_block *this,
>  	return NOTIFY_DONE;
>  }
>  
> +static void ep93xx_reboot_unregister(void *data)
> +{
> +	unregister_restart_handler(data);
> +}
> +
>  static int ep93xx_reboot_probe(struct auxiliary_device *adev,
>  			       const struct auxiliary_device_id *id)
>  {
> @@ -65,7 +70,8 @@ static int ep93xx_reboot_probe(struct auxiliary_device *adev,
>  	if (err)
>  		return dev_err_probe(dev, err, "can't register restart notifier\n");
>  
> -	return 0;
> +	return devm_add_action_or_reset(dev, ep93xx_reboot_unregister,
> +					&priv->restart_handler);
>  }
>  
>  static const struct auxiliary_device_id ep93xx_reboot_ids[] = {
> 
> -- 
> 2.43.0
> 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-12-05 22:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  9:47 [PATCH 0/4] power: reset: Unregister restart handlers on removal Tian Xuechen
2026-11-29  9:47 ` [PATCH 1/4] power: reset: ep93xx: Unregister the restart handler " Tian Xuechen
2026-12-05 22:57   ` Sebastian Reichel [this message]
2026-11-29  9:47 ` [PATCH 2/4] power: reset: hisi: Unregister the restart handler on unbind Tian Xuechen
2026-12-05 22:56   ` Sebastian Reichel
2026-11-29  9:47 ` [PATCH 3/4] power: reset: ocelot: Unregister the restart handler on removal Tian Xuechen
2026-12-05 22:57   ` Sebastian Reichel
2026-11-29  9:47 ` [PATCH 4/4] power: reset: syscon-reboot: " Tian Xuechen
2026-12-05 22:58   ` Sebastian Reichel

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=axSWq2R_d3_9djAg@venus \
    --to=sebastian.reichel@collabora.com \
    --cc=202300460064@mail.sdu.edu.cn \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=fkan@apm.com \
    --cc=liguangshuo@mail.sdu.edu.cn \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nikita.shubin@maquefel.me \
    --cc=vkoul@kernel.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