summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhoat Harpal <hdhoat@codeaurora.org>2017-08-18 16:06:48 +0530
committerDhoat Harpal <hdhoat@codeaurora.org>2017-08-21 21:05:29 +0530
commite8574a4350d7765b7c8d4879b98a476ae7d8fc97 (patch)
tree72d33f881b6e8daa1b50f7ea031e5fc8b8ca7e13
parenta49bb61510b938152025049730fa922c5da950a1 (diff)
soc: qcom: glink: Initialize dummy xprt with dummy functions
Few function pointers are left uninitialized in dummy transport. System can crash if these function pointer get dereferenced. Initialize all the function pointers which can get called, with dummy functions. CRs-Fixed: 2067859 Change-Id: I9172776d9ffa0af5deb9898125fc6403fdcdee0f Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
-rw-r--r--drivers/soc/qcom/glink.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/soc/qcom/glink.c b/drivers/soc/qcom/glink.c
index e0d9f68ceef9..f3debd14c27b 100644
--- a/drivers/soc/qcom/glink.c
+++ b/drivers/soc/qcom/glink.c
@@ -2372,6 +2372,35 @@ static void dummy_tx_cmd_ch_remote_close_ack(struct glink_transport_if *if_ptr,
}
/**
+ * dummy_tx_cmd_ch_open() - dummy channel open cmd sending function
+ * @if_ptr: The transport to transmit on.
+ * @lcid: The local channel id to encode.
+ * @name: The channel name to encode.
+ * @req_xprt: The transport the core would like to migrate this channel to.
+ *
+ * Return: 0 on success or standard Linux error code.
+ */
+static int dummy_tx_cmd_ch_open(struct glink_transport_if *if_ptr,
+ uint32_t lcid, const char *name,
+ uint16_t req_xprt)
+{
+ return -EOPNOTSUPP;
+}
+
+/**
+ * dummy_tx_cmd_ch_remote_open_ack() - convert a channel open ack cmd to wire
+ * format and transmit
+ * @if_ptr: The transport to transmit on.
+ * @rcid: The remote channel id to encode.
+ * @xprt_resp: The response to a transport migration request.
+ */
+static void dummy_tx_cmd_ch_remote_open_ack(struct glink_transport_if *if_ptr,
+ uint32_t rcid, uint16_t xprt_resp)
+{
+ /* intentionally left blank */
+}
+
+/**
* dummy_get_power_vote_ramp_time() - Dummy Power vote ramp time
* @if_ptr: The transport to transmit on.
* @state: The power state being requested from the transport.
@@ -4184,8 +4213,14 @@ static struct glink_core_xprt_ctx *glink_create_dummy_xprt_ctx(
if_ptr->tx_cmd_remote_rx_intent_req_ack =
dummy_tx_cmd_remote_rx_intent_req_ack;
if_ptr->tx_cmd_set_sigs = dummy_tx_cmd_set_sigs;
+ if_ptr->tx_cmd_ch_open = dummy_tx_cmd_ch_open;
+ if_ptr->tx_cmd_ch_remote_open_ack = dummy_tx_cmd_ch_remote_open_ack;
if_ptr->tx_cmd_ch_close = dummy_tx_cmd_ch_close;
if_ptr->tx_cmd_ch_remote_close_ack = dummy_tx_cmd_ch_remote_close_ack;
+ if_ptr->tx_cmd_tracer_pkt = dummy_tx_cmd_tracer_pkt;
+ if_ptr->get_power_vote_ramp_time = dummy_get_power_vote_ramp_time;
+ if_ptr->power_vote = dummy_power_vote;
+ if_ptr->power_unvote = dummy_power_unvote;
xprt_ptr->ops = if_ptr;
xprt_ptr->log_ctx = log_ctx;