summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Chen <chenche@codeaurora.org>2017-01-17 17:51:04 -0500
committerGerrit - the friendly Code Review server <code-review@localhost>2017-03-22 23:05:02 -0700
commiteb79340da45bc7c27721ea78e7fb8a6ca7eb3fc3 (patch)
tree802bab40a80b294d319f84cfcff5b7d228897419
parent90c6439d081e5d81f349fb3c38ddbc8fd606340b (diff)
ASoC: msm: qdsp6v2: add memset of adm open before usage
Add memset of adm open v5 and v6 structure before value assignment to avoid warning of uninitialized stack. CRs-fixed: 1112462 Change-Id: I18681f6b191e96118fde9ae774d105dc6b677858 Signed-off-by: Derek Chen <chenche@codeaurora.org>
-rw-r--r--sound/soc/msm/qdsp6v2/q6adm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/msm/qdsp6v2/q6adm.c b/sound/soc/msm/qdsp6v2/q6adm.c
index 4a4f02c7b9b6..2da7e6dc11e7 100644
--- a/sound/soc/msm/qdsp6v2/q6adm.c
+++ b/sound/soc/msm/qdsp6v2/q6adm.c
@@ -2463,6 +2463,7 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
pr_err("%s: DTS_EAGLE mmap did not work!",
__func__);
}
+ memset(&open, 0, sizeof(struct adm_cmd_device_open_v5));
open.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD,
APR_HDR_LEN(APR_HDR_SIZE),
APR_PKT_VER);
@@ -2506,6 +2507,8 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
if ((this_adm.num_ec_ref_rx_chans != 0) && (path != 1) &&
(open.endpoint_id_2 != 0xFFFF)) {
+ memset(&open_v6, 0,
+ sizeof(struct adm_cmd_device_open_v6));
memcpy(&open_v6, &open,
sizeof(struct adm_cmd_device_open_v5));
open_v6.hdr.opcode = ADM_CMD_DEVICE_OPEN_V6;