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>
This commit is contained in:
parent
a49bb61510
commit
e8574a4350
1 changed files with 35 additions and 0 deletions
|
@ -2371,6 +2371,35 @@ static void dummy_tx_cmd_ch_remote_close_ack(struct glink_transport_if *if_ptr,
|
|||
/* intentionally left blank */
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue