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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201110101108.GC30029@e120937-lin>
Date:   Tue, 10 Nov 2020 10:11:08 +0000
From:   Cristian Marussi <cristian.marussi@....com>
To:     Qinglang Miao <miaoqinglang@...wei.com>
Cc:     Sudeep Holla <sudeep.holla@....com>, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2] firmware: arm_scmi: fix missing destroy_workqueue()

Hi

On Tue, Nov 10, 2020 at 03:42:21PM +0800, Qinglang Miao wrote:
> destroy_workqueue seems necessary before return from
> scmi_notification_init in the error handling case when
> fails to do devm_kcalloc(). Fix this by simply moving
> devm_kcalloc to the front.
> 
> Fixes: bd31b249692e ("firmware: arm_scmi: Add notification dispatch and delivery")
> Suggested-by: Cristian Marussi <cristian.marussi@....com>
> Signed-off-by: Qinglang Miao <miaoqinglang@...wei.com>
> ---
>  v2: fix this problem by simply moving codes.
> 
>  drivers/firmware/arm_scmi/notify.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
> index 2754f9d01636..fdb2cc95dfde 100644
> --- a/drivers/firmware/arm_scmi/notify.c
> +++ b/drivers/firmware/arm_scmi/notify.c
> @@ -1468,17 +1468,17 @@ int scmi_notification_init(struct scmi_handle *handle)
>  	ni->gid = gid;
>  	ni->handle = handle;
>  
> +	ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTO,
> +						sizeof(char *), GFP_KERNEL);
> +	if (!ni->registered_protocols)
> +		goto err;
> +
>  	ni->notify_wq = alloc_workqueue("scmi_notify",
>  					WQ_UNBOUND | WQ_FREEZABLE | WQ_SYSFS,
>  					0);
>  	if (!ni->notify_wq)
>  		goto err;
>  
> -	ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTO,
> -						sizeof(char *), GFP_KERNEL);
> -	if (!ni->registered_protocols)
> -		goto err;
> -
>  	mutex_init(&ni->pending_mtx);
>  	hash_init(ni->pending_events_handlers);
>  

Looks good to me.

Just be aware that it seems you're patch is not based on top of
sudeep/for-next/scmi at:

b9ceca6be432 firmware: arm_scmi: Fix duplicate workqueue name

whose top commit indeed changes the workqueue naming style:

1fc2dd1864c2b (Cristian Marussi 2020-07-01 16:53:40 +0100 1476)
b9ceca6be4323 (Florian Fainelli 2020-10-13 19:17:37 -0700 1477)         ni->notify_wq = alloc_workqueue(dev_name(handle->dev),
bd31b249692e2 (Cristian Marussi 2020-07-01 16:53:42 +0100 1478)                                         WQ_UNBOUND | WQ_FREEZABLE | WQ_SYSFS,
bd31b249692e2 (Cristian Marussi 2020-07-01 16:53:42 +0100 1479)                                         0);
bd31b249692e2 (Cristian Marussi 2020-07-01 16:53:42 +0100 1480)         if (!ni->notify_wq)
bd31b249692e2 (Cristian Marussi 2020-07-01 16:53:42 +0100 1481)                 goto err;
bd31b249692e2 (Cristian Marussi 2020-07-01 16:53:42 +0100 1482)

So I'm a bit worried it could fail to apply cleanly as it is, it would
be better if possible to rebase it on top of for-next/scmi.

Beside this

Reviewed-by: Cristian Marussi <cristian.marussi@....com>

Thanks

Cristian

> -- 
> 2.23.0
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ