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] [day] [month] [year] [list]
Message-ID: <87y0kz8mio.ffs@tglx>
Date: Wed, 11 Feb 2026 13:58:39 +0100
From: Thomas Gleixner <tglx@...nel.org>
To: Zhan Xusheng <zhanxusheng1024@...il.com>, Frederic Weisbecker
 <frederic@...nel.org>
Cc: linux-kernel@...r.kernel.org, Zhan Xusheng <zhanxusheng@...omi.com>
Subject: Re: [PATCH] clockevents: Add error handling and rollback in
 tick_init_sysfs()

On Tue, Feb 10 2026 at 15:27, Zhan Xusheng wrote:
> @@ -756,12 +756,24 @@ static int __init tick_init_sysfs(void)
>  		dev->id = cpu;
>  		dev->bus = &clockevents_subsys;
>  		err = device_register(dev);
> -		if (!err)
> -			err = device_create_file(dev, &dev_attr_current_device);
> -		if (!err)
> -			err = device_create_file(dev, &dev_attr_unbind_device);
>  		if (err)
>  			return err;
> +
> +		err = device_create_file(dev, &dev_attr_current_device);
> +		if (err)
> +			goto err_unregister;
> +
> +		err = device_create_file(dev, &dev_attr_unbind_device);
> +		if (err)
> +			goto err_remove_file;
> +
> +		continue;
> +
> +err_remove_file:
> +		device_remove_file(dev, &dev_attr_current_device);
> +err_unregister:
> +		device_unregister(dev);
> +		return err;

So this leaves already created per CPU files and devices around which is
inconsistent as well.

So what's the point of this half baked cleanup?

If this fails and it only can fail because of out of memory then the
system is doomed anyway. Cleanup up a couple of kilobytes wont make a
difference at all

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ