All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: Fix the driver data not set issue
@ 2014-11-04  6:45 Jie Yang
  2014-11-04 11:44 ` Mark Brown
  2014-11-04 15:48 ` Liam Girdwood
  0 siblings, 2 replies; 4+ messages in thread
From: Jie Yang @ 2014-11-04  6:45 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, liam.r.girdwood

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.

Signed-off-by: Jie Yang <yang.jie@intel.com>
---
 sound/soc/intel/sst-haswell-pcm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c
index 21f1316..bc02a6e 100644
--- a/sound/soc/intel/sst-haswell-pcm.c
+++ b/sound/soc/intel/sst-haswell-pcm.c
@@ -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;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: Intel: Fix the driver data not set issue
  2014-11-04  6:45 [PATCH] ASoC: Intel: Fix the driver data not set issue Jie Yang
@ 2014-11-04 11:44 ` Mark Brown
  2014-11-04 15:48 ` Liam Girdwood
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-11-04 11:44 UTC (permalink / raw)
  To: Jie Yang; +Cc: alsa-devel, liam.r.girdwood


[-- Attachment #1.1: Type: text/plain, Size: 272 bytes --]

On Tue, Nov 04, 2014 at 02:45:24PM +0800, Jie Yang wrote:
> 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.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: Intel: Fix the driver data not set issue
  2014-11-04  6:45 [PATCH] ASoC: Intel: Fix the driver data not set issue Jie Yang
  2014-11-04 11:44 ` Mark Brown
@ 2014-11-04 15:48 ` Liam Girdwood
  2014-11-05  7:41   ` Liam Girdwood
  1 sibling, 1 reply; 4+ messages in thread
From: Liam Girdwood @ 2014-11-04 15:48 UTC (permalink / raw)
  To: Jie Yang; +Cc: alsa-devel, broonie

On Tue, 2014-11-04 at 14:45 +0800, Jie Yang wrote:
> 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.
> 
> Signed-off-by: Jie Yang <yang.jie@intel.com>
> ---
>  sound/soc/intel/sst-haswell-pcm.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c
> index 21f1316..bc02a6e 100644
> --- a/sound/soc/intel/sst-haswell-pcm.c
> +++ b/sound/soc/intel/sst-haswell-pcm.c
> @@ -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.o
sound/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
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ASoC: Intel: Fix the driver data not set issue
  2014-11-04 15:48 ` Liam Girdwood
@ 2014-11-05  7:41   ` Liam Girdwood
  0 siblings, 0 replies; 4+ messages in thread
From: Liam Girdwood @ 2014-11-05  7:41 UTC (permalink / raw)
  To: Jie Yang; +Cc: alsa-devel, broonie

On Tue, 2014-11-04 at 15:48 +0000, Liam Girdwood wrote:
> On Tue, 2014-11-04 at 14:45 +0800, Jie Yang wrote:
> > 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.
> > 
> > Signed-off-by: Jie Yang <yang.jie@intel.com>
> > ---
> >  sound/soc/intel/sst-haswell-pcm.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c
> > index 21f1316..bc02a6e 100644
> > --- a/sound/soc/intel/sst-haswell-pcm.c
> > +++ b/sound/soc/intel/sst-haswell-pcm.c
> > @@ -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.o
> sound/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
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-05  7:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-04  6:45 [PATCH] ASoC: Intel: Fix the driver data not set issue Jie Yang
2014-11-04 11:44 ` Mark Brown
2014-11-04 15:48 ` Liam Girdwood
2014-11-05  7:41   ` Liam Girdwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.