Re: [ 47/53] dca: check against empty dca_domains list before unregister provider

Jiri Slaby
2013-02-28T22:05:03Z

On 02/27/2013 12:58 AM, Greg Kroah-Hartman wrote:
> 3.0-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Maciej Sosnowski <maciej.sosnowski@intel.com>
>
> commit c419fcfd071cf34ba00f9f65282583772d2655e7 upstream.
>
> When providers get blocked unregister_dca_providers() is called ending up
> with dca_providers and dca_domain lists emptied. Dca should be prevented from
> trying to unregister any provider if dca_domain list is found empty.
>
> Reported-by: Jiang Liu <jiang.liu@huawei.com>
> Tested-by: Gaohuai Han <hangaohuai@huawei.com>
> Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
> Signed-off-by: Dan Williams <djbw@fb.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> drivers/dca/dca-core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> --- a/drivers/dca/dca-core.c
> +++ b/drivers/dca/dca-core.c
> @@ -409,6 +409,11 @@ void unregister_dca_provider(struct dca_
>
> spin_lock_irqsave(&dca_lock, flags);
>
> + if (list_empty(&dca_domains)) {
> + raw_spin_unlock_irqrestore(&dca_lock, flags);

Hi, this is an incorrect backport. It should be spin_unlock_irqrestore
obviously...

--
js
suse labs