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:
Dhoat Harpal 2017-08-18 16:06:48 +05:30 committed by Gerrit - the friendly Code Review server
parent f762ffa7e6
commit ba841a91cd
1 changed files with 32 additions and 0 deletions

View File

@ -1810,6 +1810,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 */
}
/**
* notif_if_up_all_xprts() - Check and notify existing transport state if up
* @notif_info: Data structure containing transport information to be notified.
@ -3005,8 +3034,11 @@ 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;
xprt_ptr->ops = if_ptr;
spin_lock_init(&xprt_ptr->xprt_ctx_lock_lhb1);