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: <974e0c5e-7929-80fa-e3b5-e9394a5e55b0@gmail.com>
Date:   Tue, 26 Apr 2022 09:04:19 +0900
From:   Chanwoo Choi <cwchoi00@...il.com>
To:     Li Jun <jun.li@....com>, myungjoo.ham@...sung.com,
        cw00.choi@...sung.com, krzk@...nel.org
Cc:     linux-kernel@...r.kernel.org, frank.li@....com, xu.yang_2@....com
Subject: Re: [PATCH v3 1/2] extcon: ptn5150: add queue work sync before driver
 release

On 22. 4. 19. 21:44, Li Jun wrote:
> Add device managed action to sync pending queue work, otherwise
> the queued work may run after the work is destroyed.
> 
> Fixes: 4ed754de2d66 ("extcon: Add support for ptn5150 extcon driver")
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> Signed-off-by: Li Jun <jun.li@....com>
> ---
> change for v3:
> - Add Fixes and R-b tag.
> 
>   drivers/extcon/extcon-ptn5150.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5150.c
> index 5b9a3cf8df26..2a7874108df8 100644
> --- a/drivers/extcon/extcon-ptn5150.c
> +++ b/drivers/extcon/extcon-ptn5150.c
> @@ -194,6 +194,13 @@ static int ptn5150_init_dev_type(struct ptn5150_info *info)
>   	return 0;
>   }
>   
> +static void ptn5150_work_sync_and_put(void *data)
> +{
> +	struct ptn5150_info *info = data;
> +
> +	cancel_work_sync(&info->irq_work);
> +}
> +
>   static int ptn5150_i2c_probe(struct i2c_client *i2c)
>   {
>   	struct device *dev = &i2c->dev;
> @@ -284,6 +291,10 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c)
>   	if (ret)
>   		return -EINVAL;
>   
> +	ret = devm_add_action_or_reset(dev, ptn5150_work_sync_and_put, info);
> +	if (ret)
> +		return ret;
> +
>   	/*
>   	 * Update current extcon state if for example OTG connection was there
>   	 * before the probe

Applied them. Thanks.

-- 
Best Regards,
Samsung Electronics
Chanwoo Choi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ