Re: [PATCH] crypto: qat - Fix missing destroy_workqueue in adf_init_aer()

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

 



On Thu, Oct 24, 2024 at 10:00:57PM +0800, Wang Hai wrote:
> The adf_init_aer() won't destroy device_reset_wq when alloc_workqueue()
> for device_sriov_wq failed. Add destroy_workqueue for device_reset_wq to
> fix this issue.
> 
> Fixes: 4469f9b23468 ("crypto: qat - re-enable sriov after pf reset")
> Signed-off-by: Wang Hai <wanghai38@xxxxxxxxxx>
> ---
>  drivers/crypto/intel/qat/qat_common/adf_aer.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/intel/qat/qat_common/adf_aer.c b/drivers/crypto/intel/qat/qat_common/adf_aer.c
> index ec7913ab00a2..907144ec7e65 100644
> --- a/drivers/crypto/intel/qat/qat_common/adf_aer.c
> +++ b/drivers/crypto/intel/qat/qat_common/adf_aer.c
> @@ -281,8 +281,10 @@ int adf_init_aer(void)
>  		return -EFAULT;
>  
>  	device_sriov_wq = alloc_workqueue("qat_device_sriov_wq", 0, 0);
> -	if (!device_sriov_wq)
> +	if (!device_sriov_wq) {
> +		destroy_workqueue(device_reset_wq);
The missing destroy_workqueue() here is intentional as the device_reset_wq
is destroyed in adf_exit_aer() which is called if adf_init_aer() fails,
see [1].

With this change, destroy_workqueue() is called twice.

Regards,

-- 
Giovanni

[1] https://elixir.bootlin.com/linux/v6.11.5/source/drivers/crypto/intel/qat/qat_common/adf_ctl_drv.c#L425




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux