RE: [PATCH -next] ACPI / EC: Add missing destroy_workqueue() on error in acpi_ec_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Yongjun

Thanks for the report.

> From: linux-acpi-owner@xxxxxxxxxxxxxxx [mailto:linux-acpi-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Wei Yongjun
> Subject: [PATCH -next] ACPI / EC: Add missing destroy_workqueue() on
> error in acpi_ec_init()
> 
> Add the missing destroy_workqueue() before return from
> acpi_ec_init() in the error handling case.
> 
> Signed-off-by: Wei Yongjun <weiyj.lk@xxxxxxxxx>
> ---
>  drivers/acpi/ec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
> index 9267554..853a55d 100644
> --- a/drivers/acpi/ec.c
> +++ b/drivers/acpi/ec.c
> @@ -1676,8 +1676,10 @@ int __init acpi_ec_init(void)
> 
>  	/* Now register the driver for the EC */
>  	result = acpi_bus_register_driver(&acpi_ec_driver);
> -	if (result < 0)
> +	if (result < 0) {
> +		destroy_workqueue(ec_query_wq);
[Lv Zheng] 
I think we should also set ec_query_wq = NULL.

>  		return -ENODEV;
> +	}
> 
[Lv Zheng] 
And probably could collect all cleanup code here before returning.

Thanks
Lv

>  	return result;
>  }
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux