]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rpmsg: glink: Fix missing mutex_init() in qcom_glink_alloc_channel()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 21 Apr 2020 12:40:09 +0000 (13:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Apr 2020 06:01:05 +0000 (08:01 +0200)
[ Upstream commit fb416f69900773d5a6030c909114099f92d07ab9 ]

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>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rpmsg/qcom_glink_native.c

index 114481c9fba1278074a01b7b92f0947a7e9148ab..7802663efe3326519e0e943d246b29e1f183a343 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);