public inbox for linux-remoteproc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] rpmsg: glink: Fix missing mutex_init() in qcom_glink_alloc_channel()
@ 2018-01-02 11:47 Wei Yongjun
  2018-01-02 17:23 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2018-01-02 11:47 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson; +Cc: Wei Yongjun, linux-remoteproc

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>
---
 drivers/rpmsg/qcom_glink_native.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index 40d76d2..e0f31ed 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -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);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] rpmsg: glink: Fix missing mutex_init() in qcom_glink_alloc_channel()
  2018-01-02 11:47 [PATCH -next] rpmsg: glink: Fix missing mutex_init() in qcom_glink_alloc_channel() Wei Yongjun
@ 2018-01-02 17:23 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2018-01-02 17:23 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Ohad Ben-Cohen, linux-remoteproc

On Tue 02 Jan 03:47 PST 2018, Wei Yongjun wrote:

> 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>

Thanks Wei, applied.

Regards,
Bjorn

> ---
>  drivers/rpmsg/qcom_glink_native.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
> index 40d76d2..e0f31ed 100644
> --- a/drivers/rpmsg/qcom_glink_native.c
> +++ b/drivers/rpmsg/qcom_glink_native.c
> @@ -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);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-remoteproc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-02 17:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-02 11:47 [PATCH -next] rpmsg: glink: Fix missing mutex_init() in qcom_glink_alloc_channel() Wei Yongjun
2018-01-02 17:23 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox