rpmsg: glink: Fix missing mutex_init() in qcom_glink_alloc_channel()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 2 Jan 2018 11:47:03 +0000 (11:47 +0000)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 2 Jan 2018 17:23:20 +0000 (09:23 -0800)
qcom_glink_alloc_channel() allocates the mutex but not initialize it.
Use mutex_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/rpmsg/qcom_glink_native.c

index 40d76d2..e0f31ed 100644 (file)
@@ -221,6 +221,7 @@ static struct glink_channel *qcom_glink_alloc_channel(struct qcom_glink *glink,
        /* Setup glink internal glink_channel data */
        spin_lock_init(&channel->recv_lock);
        spin_lock_init(&channel->intent_lock);
+       mutex_init(&channel->intent_req_lock);
 
        channel->glink = glink;
        channel->name = kstrdup(name, GFP_KERNEL);