ASoC: Intel: Fix the driver data not set issue
Subsystems (3)
PATCH 1/1 ASoC: Intel: Fix the driver data not set issue
The priv_data is allocated again here wrongly, and it is not set to the driver data after assignment. This make the pdata->dev is NULL and oops occurs on the first call to hsw_volume_put.
The resource has been allocated in driver probe callback hsw_pcm_dev_probe, so here just remove this sencond allocation is OK.
--- sound/soc/intel/sst-haswell-pcm.c | 1 - 1 file changed, 1 deletion(-)
sound/soc/intel/sst-haswell-pcm.c +0 -1
@@ -866,7 +866,6 @@ static int hsw_pcm_probe(struct snd_soc_platform *platform) dev = platform->dev; dma_dev = pdata->dma_dev; - priv_data =devm_kzalloc (platform->dev,sizeof (*priv_data),GFP_KERNEL ); priv_data->hsw = pdata->dsp; priv_data->dev = platform->dev; priv_data->pm_state =HSW_PM_STATE_D0 ;
Signature · 1 line
1.9.1
Quoted 4 lines · Jie Yang
The
priv_datais allocated again here wrongly, and it is not set to the driver data after assignment. This make thepdata->devis NULL and oops occurs on the first call tohsw_volume_put.
Applied, thanks.
Liam Girdwood
maintainerQuoted 19 lines · Jie Yang
The
priv_datais allocated again here wrongly, and it is not set to the driver data after assignment. This make thepdata->devis NULL and oops occurs on the first call tohsw_volume_put.The resource has been allocated in driver probe callback
hsw_pcm_dev_probe, so here just remove this sencond allocation is OK.Signed-off-by Jie Yang <[email protected]>--- sound/soc/intel/sst-haswell-pcm.c | 1 - 1 file changed, 1 deletion(-)sound/soc/intel/sst-haswell-pcm.c +0
-0
sound/soc/intel/sst-haswell-pcm.c static int hsw_pcm_probe(struct snd_soc_platform *platform) · line 871
Quoted 7 lines
sound/soc/intel/sst-haswell-pcm.c +0
-1@@ -866,7 +866,6 @@ static int hsw_pcm_probe(struct snd_soc_platform *platform) dev = platform->dev; dma_dev = pdata->dma_dev; - priv_data =devm_kzalloc (platform->dev,sizeof (*priv_data),GFP_KERNEL ); priv_data->hsw = pdata->dsp; priv_data->dev = platform->dev; priv_data->pm_state =HSW_PM_STATE_D0 ;
Keyon, I've just updated git and it looks like this patch is probably missing some parts :-
CC [M] sound/soc/intel/haswell.osound/soc/intel/sst-haswell-pcm.c: In function ‘hsw_pcm_probe’:sound/soc/intel/sst-haswell-pcm.c:870:17: warning: ‘priv_data’ may be used uninitialized in this function [-Wmaybe-uninitialized]
priv_data->hsw = pdata->dsp;
^Can you fix this and re-test.
Thanks
Liam
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Liam Girdwood
maintainerQuoted 31 lines · Liam Girdwood
Quoted 19 lines · Jie Yang
The
priv_datais allocated again here wrongly, and it is not set to the driver data after assignment. This make thepdata->devis NULL and oops occurs on the first call tohsw_volume_put.The resource has been allocated in driver probe callback
hsw_pcm_dev_probe, so here just remove this sencond allocation is OK.Signed-off-by Jie Yang <[email protected]>--- sound/soc/intel/sst-haswell-pcm.c | 1 - 1 file changed, 1 deletion(-)sound/soc/intel/sst-haswell-pcm.c +0
-0sound/soc/intel/sst-haswell-pcm.c static int hsw_pcm_probe(struct snd_soc_platform *platform) · line 871
Quoted 7 lines
sound/soc/intel/sst-haswell-pcm.c +0
-1@@ -866,7 +866,6 @@ static int hsw_pcm_probe(struct snd_soc_platform *platform) dev = platform->dev; dma_dev = pdata->dma_dev; - priv_data =devm_kzalloc (platform->dev,sizeof (*priv_data),GFP_KERNEL ); priv_data->hsw = pdata->dsp; priv_data->dev = platform->dev; priv_data->pm_state =HSW_PM_STATE_D0 ;Keyon, I've just updated git and it looks like this patch is probably missing some parts :-
Quoted 8 lines
CC [M]
sound/soc/intel/haswell.osound/soc/intel/sst-haswell-pcm.c: In function ‘hsw_pcm_probe’:sound/soc/intel/sst-haswell-pcm.c:870:17: warning: ‘priv_data’ may be used uninitialized in this function [-Wmaybe-uninitialized]priv_data->hsw = pdata->dsp; ^Can you fix this and re-test.
It's actually a subsequent non upstream patch on top of this one that is causing the warning. So nothing to be done except fixing the non upstream patch.
Liam
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel