diff mbox

[V1] rpmsg: glink: Initialize the "intent_req_comp" completion variable

Message ID 1509342085-15185-1-git-send-email-aneela@codeaurora.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Arun Kumar Neelakantam Oct. 30, 2017, 5:41 a.m. UTC
The "intent_req_comp" variable is used without initialization which
results in NULL pointer dereference in qcom_glink_request_intent().

we need to initialize the completion variable before using it.

Fixes: 27b9c5b66b23 ("rpmsg: glink: Request for intents when unavailable")
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
---
 drivers/rpmsg/qcom_glink_native.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Bjorn Andersson Oct. 31, 2017, 4:27 a.m. UTC | #1
On Sun 29 Oct 22:41 PDT 2017, Arun Kumar Neelakantam wrote:

> The "intent_req_comp" variable is used without initialization which
> results in NULL pointer dereference in qcom_glink_request_intent().
> 
> we need to initialize the completion variable before using it.
> 
> Fixes: 27b9c5b66b23 ("rpmsg: glink: Request for intents when unavailable")
> Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>

Thanks, 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 5dcc9bf..fcd46ab 100644
> --- a/drivers/rpmsg/qcom_glink_native.c
> +++ b/drivers/rpmsg/qcom_glink_native.c
> @@ -227,6 +227,7 @@ static struct glink_channel *qcom_glink_alloc_channel(struct qcom_glink *glink,
>  
>  	init_completion(&channel->open_req);
>  	init_completion(&channel->open_ack);
> +	init_completion(&channel->intent_req_comp);
>  
>  	INIT_LIST_HEAD(&channel->done_intents);
>  	INIT_WORK(&channel->intent_work, qcom_glink_rx_done_work);
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 
--
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
diff mbox

Patch

diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c
index 5dcc9bf..fcd46ab 100644
--- a/drivers/rpmsg/qcom_glink_native.c
+++ b/drivers/rpmsg/qcom_glink_native.c
@@ -227,6 +227,7 @@  static struct glink_channel *qcom_glink_alloc_channel(struct qcom_glink *glink,
 
 	init_completion(&channel->open_req);
 	init_completion(&channel->open_ack);
+	init_completion(&channel->intent_req_comp);
 
 	INIT_LIST_HEAD(&channel->done_intents);
 	INIT_WORK(&channel->intent_work, qcom_glink_rx_done_work);