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: <20061005151546.31b73ab5@gondolin.boeblingen.de.ibm.com>
Date:	Thu, 5 Oct 2006 15:15:46 +0200
From:	Cornelia Huck <cornelia.huck@...ibm.com>
To:	Heiko Carstens <heiko.carstens@...ibm.com>
Cc:	Jeff Garzik <jeff@...zik.org>, Greg KH <greg@...ah.com>,
	Andrew Morton <akpm@...l.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Ashok Raj <ashok.raj@...el.com>,
	Nathan Lynch <nathanl@...tin.ibm.com>
Subject: Re: [PATCH] drivers/base: error handling fixes

On Thu, 5 Oct 2006 14:48:48 +0200,
Heiko Carstens <heiko.carstens@...ibm.com> wrote:

> If sysfs_remove_group() would also work for non-created (-existent) groups
> then the patch below would work. Unfortunately that is not the case. So one
> would have to remember if sysfs_create_group() was done and succeeded before
> calling sysfs_remove_group()...
> There must be an easier way.

<snip>

> @@ -132,11 +135,15 @@ static struct notifier_block __cpuinitda
>  
>  static int __cpuinit topology_sysfs_init(void)
>  {
> -	int i;
> -
> -	for_each_online_cpu(i) {
> -		topology_cpu_callback(&topology_cpu_notifier, CPU_ONLINE,
> -				(void *)(long)i);
> +	struct sys_device *sys_dev;
> +	int cpu;
> +	int rc;
> +
> +	for_each_online_cpu(cpu) {
> +		sys_dev = get_cpu_sysdev(cpu);
> +		rc = topology_add_dev(sys_dev);
> +		if (rc)
> +			return rc;
>  	}
>  
>  	register_hotcpu_notifier(&topology_cpu_notifier);

Shouldn't the added attribute groups be removed again in the failure
case?

Also, it might be a bit overkill to fail the whole initialization
because of one "bad" cpu. (And the "bad" cpu wouldn't matter if we
could safely remove non-existent groups :)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ