From: Thomas Gleixner <tglx@linutronix.de>
To: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>,
anna-maria@linutronix.de, frederic@kernel.org
Cc: linux-kernel@vger.kernel.org,
Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>,
stable@vger.kernel.org
Subject: Re: [PATCH] clockevents: add a error handling in tick_broadcast_init_sysfs()
Date: Fri, 19 Dec 2025 11:17:27 +0100 [thread overview]
Message-ID: <875xa2bwso.ffs@tglx> (raw)
In-Reply-To: <20251218090625.557965-1-lihaoxiang@isrc.iscas.ac.cn>
On Thu, Dec 18 2025 at 17:06, Haoxiang Li wrote:
> If device_register() fails, call put_device() to drop
> the device reference.
>
> Fixes: 501f867064e9 ("clockevents: Provide sysfs interface")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
> ---
> kernel/time/clockevents.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
> index a59bc75ab7c5..94e223cf9c74 100644
> --- a/kernel/time/clockevents.c
> +++ b/kernel/time/clockevents.c
> @@ -733,8 +733,12 @@ static __init int tick_broadcast_init_sysfs(void)
> {
> int err = device_register(&tick_bc_dev);
>
> - if (!err)
> - err = device_create_file(&tick_bc_dev, &dev_attr_current_device);
> + if (err) {
> + put_deivce(&tick_bc_dev);
My brain compiler tells me that this was not even compiled. Try again.
next prev parent reply other threads:[~2025-12-19 10:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 9:06 [PATCH] clockevents: add a error handling in tick_broadcast_init_sysfs() Haoxiang Li
2025-12-19 10:17 ` Thomas Gleixner [this message]
2025-12-19 13:28 ` Haoxiang Li
2025-12-20 14:59 ` kernel test robot
2025-12-20 15:33 ` kernel test robot
2025-12-20 21:34 ` kernel test robot
2025-12-22 6:24 ` kernel test robot
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=875xa2bwso.ffs@tglx \
--to=tglx@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=frederic@kernel.org \
--cc=lihaoxiang@isrc.iscas.ac.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.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