mirror of
https://github.com/torvalds/linux.git
synced 2024-11-05 19:41:54 +00:00
ASoC: Intel: fix warning reported by static check tool smatch
The smatch tool report warning: ... CHECK sound/soc/intel/sst-haswell-pcm.c sound/soc/intel/sst-haswell-pcm.c:1110 hsw_pcm_probe() error: buffer overflow\ 'hsw_dais' 4 <= 4 sound/soc/intel/sst-haswell-pcm.c:1112 hsw_pcm_probe() error: buffer overflow\ 'hsw_dais' 4 <= 4 ... fix it by use its own struct member for post-process module, rather than sharing unused pcm member. Signed-off-by: Lu, Han <han.lu@intel.com> Acked-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
5d5b275d72
commit
2c0ed63492
@ -137,6 +137,7 @@ struct hsw_priv_data {
|
|||||||
struct device *dev;
|
struct device *dev;
|
||||||
enum hsw_pm_state pm_state;
|
enum hsw_pm_state pm_state;
|
||||||
struct snd_soc_card *soc_card;
|
struct snd_soc_card *soc_card;
|
||||||
|
struct sst_module_runtime *runtime_waves; /* sound effect module */
|
||||||
|
|
||||||
/* page tables */
|
/* page tables */
|
||||||
struct snd_dma_buffer dmab[HSW_PCM_COUNT][2];
|
struct snd_dma_buffer dmab[HSW_PCM_COUNT][2];
|
||||||
@ -902,13 +903,10 @@ static int hsw_pcm_create_modules(struct hsw_priv_data *pdata)
|
|||||||
|
|
||||||
/* create runtime blocks for module waves */
|
/* create runtime blocks for module waves */
|
||||||
if (sst_hsw_is_module_loaded(hsw, SST_HSW_MODULE_WAVES)) {
|
if (sst_hsw_is_module_loaded(hsw, SST_HSW_MODULE_WAVES)) {
|
||||||
pcm_data = &pdata->pcm[HSW_PCM_COUNT-1][0];
|
pdata->runtime_waves = sst_hsw_runtime_module_create(hsw,
|
||||||
pcm_data->runtime = sst_hsw_runtime_module_create(hsw,
|
SST_HSW_MODULE_WAVES, 0);
|
||||||
SST_HSW_MODULE_WAVES, pcm_data->persistent_offset);
|
if (pdata->runtime_waves == NULL)
|
||||||
if (pcm_data->runtime == NULL)
|
|
||||||
goto err;
|
goto err;
|
||||||
pcm_data->persistent_offset =
|
|
||||||
pcm_data->runtime->persistent_offset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -933,8 +931,7 @@ static void hsw_pcm_free_modules(struct hsw_priv_data *pdata)
|
|||||||
sst_hsw_runtime_module_free(pcm_data->runtime);
|
sst_hsw_runtime_module_free(pcm_data->runtime);
|
||||||
}
|
}
|
||||||
if (sst_hsw_is_module_loaded(hsw, SST_HSW_MODULE_WAVES)) {
|
if (sst_hsw_is_module_loaded(hsw, SST_HSW_MODULE_WAVES)) {
|
||||||
pcm_data = &pdata->pcm[HSW_PCM_COUNT-1][0];
|
sst_hsw_runtime_module_free(pdata->runtime_waves);
|
||||||
sst_hsw_runtime_module_free(pcm_data->runtime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user