[PATCH] ppc64: Thermal control for SMU based machines

Andrew Morton akpm at osdl.org
Wed Oct 12 10:03:58 EST 2005


Benjamin Herrenschmidt <benh at kernel.crashing.org> wrote:
>
> +int wf_register_client(struct notifier_block *nb)
> +{
> +	int rc;
> +	struct wf_control *ct;
> +	struct wf_sensor *sr;
> +
> +	down(&wf_lock);
> +	rc = notifier_chain_register(&wf_client_list, nb);
> +	if (rc != 0)
> +		goto bail;
> +	wf_client_count++;
> +	list_for_each_entry(ct, &wf_controls, link)
> +		wf_notify(WF_EVENT_NEW_CONTROL, ct);
> +	list_for_each_entry(sr, &wf_sensors, link)
> +		wf_notify(WF_EVENT_NEW_SENSOR, sr);
> +	if (wf_client_count == 1)
> +		wf_start_thread();
> +	up(&wf_lock);
> + bail:
> +	return rc;
> +}

This will leave wf_lock held on error.



More information about the Linuxppc64-dev mailing list