diff mbox series

[-next] firmware: arm_scmi: optee: Fix missing mutex_init()

Message ID 20211123083620.2366860-1-weiyongjun1@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] firmware: arm_scmi: optee: Fix missing mutex_init() | expand

Commit Message

Wei Yongjun Nov. 23, 2021, 8:36 a.m. UTC
The driver allocates the mutex but not initialize it.
Use mutex_init() on it to initialize it correctly.

Fixes: 5f90f189a052 ("firmware: arm_scmi: Add optee transport")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/firmware/arm_scmi/optee.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Etienne Carriere Nov. 23, 2021, 1:17 p.m. UTC | #1
On Tue, 23 Nov 2021 at 09:23, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> The driver allocates the mutex but not initialize it.
> Use mutex_init() on it to initialize it correctly.
>
> Fixes: 5f90f189a052 ("firmware: arm_scmi: Add optee transport")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/firmware/arm_scmi/optee.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/firmware/arm_scmi/optee.c b/drivers/firmware/arm_scmi/optee.c
> index d9819b0197ec..901737c9f5f8 100644
> --- a/drivers/firmware/arm_scmi/optee.c
> +++ b/drivers/firmware/arm_scmi/optee.c
> @@ -506,6 +506,7 @@ static int scmi_optee_service_probe(struct device *dev)
>         agent->dev = dev;
>         agent->tee_ctx = tee_ctx;
>         INIT_LIST_HEAD(&agent->channel_list);
> +       mutex_init(&agent->mu);
>
>         ret = get_capabilities(agent);
>         if (ret)
>

`Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>`

Indeed. Thanks for the fix.
Etienne
Sudeep Holla Nov. 25, 2021, 12:36 p.m. UTC | #2
On Tue, 23 Nov 2021 08:36:20 +0000, Wei Yongjun wrote:
> The driver allocates the mutex but not initialize it.
> Use mutex_init() on it to initialize it correctly.
> 
> 

Applied to sudeep.holla/linux (for-next/scmi), thanks!

[1/1] firmware: arm_scmi: optee: Fix missing mutex_init()
      https://git.kernel.org/sudeep.holla/c/61bc76be36

--
Regards,
Sudeep
diff mbox series

Patch

diff --git a/drivers/firmware/arm_scmi/optee.c b/drivers/firmware/arm_scmi/optee.c
index d9819b0197ec..901737c9f5f8 100644
--- a/drivers/firmware/arm_scmi/optee.c
+++ b/drivers/firmware/arm_scmi/optee.c
@@ -506,6 +506,7 @@  static int scmi_optee_service_probe(struct device *dev)
 	agent->dev = dev;
 	agent->tee_ctx = tee_ctx;
 	INIT_LIST_HEAD(&agent->channel_list);
+	mutex_init(&agent->mu);
 
 	ret = get_capabilities(agent);
 	if (ret)