Skip to contentSkip to conversation

rpmsg: glink: Initialize the "intent_req_comp" completion variable

PATCH In review Arun Kumar Neelakantam 2 participants 2 messages Oct 27, 2017 – Oct 28, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpmsg: glink: Initialize the "intent_req_comp" completion variable

The "intent_req_comp" variable is used without initialization which results in NULL pointer derefernce in qcom_glink_request_intent().

we need to initialize the completion variable before using it.

Fixes 27b9c5b66b23 ("rpmsg: glink: Request for intents when unavailable")
---
 drivers/rpmsg/qcom_glink_native.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rpmsg/qcom_glink_native.c +1 -0
index 5dcc9bf..fcd46ab 100644
@@ -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);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw
Quoted 3 lines · Arun Kumar Neelakantam

The "intent_req_comp" variable is used without initialization which results in NULL pointer derefernce in qcom_glink_request_intent().

Typo on dereference.

Thanks,
Chris

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project