firmware: arm_scmi: optee: Fix missing mutex_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 23 Nov 2021 08:36:20 +0000 (08:36 +0000)
committerSudeep Holla <sudeep.holla@arm.com>
Tue, 23 Nov 2021 14:59:46 +0000 (14:59 +0000)
The driver allocates the mutex but not initialize it.
Use mutex_init() on it to initialize it correctly.

Link: https://lore.kernel.org/r/20211123083620.2366860-1-weiyongjun1@huawei.com
Fixes: 5f90f189a052 ("firmware: arm_scmi: Add optee transport")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/optee.c

index d9819b0197ec68b8fb8460b03c351bd972ee48ed..901737c9f5f8c7175596b4e7387dc92ebe4da6a1 100644 (file)
@@ -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)