lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251219132817.625559-1-lihaoxiang@isrc.iscas.ac.cn>
Date: Fri, 19 Dec 2025 21:28:17 +0800
From: Haoxiang Li <lihaoxiang@...c.iscas.ac.cn>
To: tglx@...utronix.de
Cc: anna-maria@...utronix.de,
	frederic@...nel.org,
	lihaoxiang@...c.iscas.ac.cn,
	linux-kernel@...r.kernel.org,
	stable@...r.kernel.org
Subject: Re: [PATCH] clockevents: add a error handling in tick_broadcast_init_sysfs()

On Fri, 19 Dec 2025 11:17:27 +0100, Thomas Gleixner wrote:
>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@...r.kernel.org
> > Signed-off-by: Haoxiang Li <lihaoxiang@...c.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.

Sorry for my oversight. However, I found that tick_bc_dev is a static struct.
Is the error handling here pointless?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ