rpmsg: glink: Initialize the "intent_req_comp" completion variable
authorArun Kumar Neelakantam <aneela@codeaurora.org>
Mon, 30 Oct 2017 05:41:24 +0000 (11:11 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2017 09:10:29 +0000 (10:10 +0100)
[ Upstream commit 2394facb17bcace4b3c19b50202177a5d8903b64 ]

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>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rpmsg/qcom_glink_native.c

index e3242a0925a671e51714ee858593c311b5f92691..e8e12c2b1d0e0c01d7fc16972bd19f731b15263b 100644 (file)
@@ -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);