MLK-18073: ASoC: fsl_dsp: fix uninitialized scalar variable issue
This patch is used to fix Coverity-1793874, Coverity-1793875, Coverity-1793876, Coverity-1793877 issue. The icm_base_info_t is not initialized before using, so use memset() to initialize it to fix these issues. Signed-off-by: Weiguang Kong <weiguang.kong@nxp.com>
This commit is contained in:
committed by
Dong Aisheng
parent
7d877756eb
commit
d4a9dadb61
@ -817,6 +817,7 @@ static long fsl_hifi4_init_codec(struct fsl_hifi4 *hifi4_priv,
|
||||
ext_msg.phys = hifi4_priv->msg_buf_phys;
|
||||
ext_msg.size = sizeof(struct icm_base_info_t);
|
||||
|
||||
memset(&icm_base_info_t, 0, sizeof(struct icm_base_info_t));
|
||||
icm_base_info_t.process_id = id;
|
||||
icm_base_info_t.codec_id = process_info->codec_id;
|
||||
|
||||
@ -1311,6 +1312,7 @@ static long fsl_hifi4_codec_open(struct fsl_hifi4 *hifi4_priv,
|
||||
ext_msg.phys = hifi4_priv->msg_buf_phys;
|
||||
ext_msg.size = sizeof(struct icm_base_info_t);
|
||||
|
||||
memset(&icm_base_info_t, 0, sizeof(struct icm_base_info_t));
|
||||
icm_base_info_t.process_id = id;
|
||||
|
||||
memcpy(hifi4_priv->msg_buf_virt, &icm_base_info_t,
|
||||
@ -1355,6 +1357,7 @@ static int fsl_hifi4_codec_close(struct fsl_hifi4 *hifi4_priv,
|
||||
ext_msg.phys = hifi4_priv->msg_buf_phys;
|
||||
ext_msg.size = sizeof(struct icm_base_info_t);
|
||||
|
||||
memset(&icm_base_info_t, 0, sizeof(struct icm_base_info_t));
|
||||
icm_base_info_t.process_id = id;
|
||||
|
||||
memcpy(hifi4_priv->msg_buf_virt, &icm_base_info_t,
|
||||
@ -1402,6 +1405,7 @@ static int fsl_hifi4_codec_reset(struct fsl_hifi4 *hifi4_priv,
|
||||
ext_msg.phys = hifi4_priv->msg_buf_phys;
|
||||
ext_msg.size = sizeof(struct icm_base_info_t);
|
||||
|
||||
memset(&icm_base_info_t, 0, sizeof(struct icm_base_info_t));
|
||||
icm_base_info_t.process_id = id;
|
||||
|
||||
memcpy(hifi4_priv->msg_buf_virt, &icm_base_info_t,
|
||||
|
||||
Reference in New Issue
Block a user