Skip to content

Commit

Permalink
ASoC: fill in snd_soc_pcm_runtime.card before calling snd_soc_dai_lin…
Browse files Browse the repository at this point in the history
…k.init()

The .card member of the snd_soc_pcm_runtime structure pointed to by the
snd_soc_dai_link.init() argument used to be initialized before the
function being called. This has changed, probably unintentionally,
after recent refactorings. Since the function implementations are free
to make use of this pointer, move its assignment back before the
function is called to avoid NULL pointer dereferences.

Created and tested on Amstrad Delta againts linux-2.6.38-rc2

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Janusz Krzysztofik authored and Mark Brown committed Feb 2, 2011
1 parent f019ee5 commit 0962bb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,7 @@ static int soc_post_component_init(struct snd_soc_card *card,
rtd = &card->rtd_aux[num];
name = aux_dev->name;
}
rtd->card = card;

/* machine controls, routes and widgets are not prefixed */
temp = codec->name_prefix;
Expand All @@ -1471,7 +1472,6 @@ static int soc_post_component_init(struct snd_soc_card *card,

/* register the rtd device */
rtd->codec = codec;
rtd->card = card;
rtd->dev.parent = card->dev;
rtd->dev.release = rtd_release;
rtd->dev.init_name = name;
Expand Down

0 comments on commit 0962bb2

Please sign in to comment.