aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>2011-02-02 15:11:41 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-02-02 15:52:06 -0500
commit0962bb217ac74c4b8fae34c5367ebc63131c962c (patch)
tree27838d15c8936bff0329c7092e1eaae749a36246 /sound
parentf019ee5feb344ff0b22b58df4568676295aae14f (diff)
ASoC: fill in snd_soc_pcm_runtime.card before calling snd_soc_dai_link.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>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c4b60610beb0..c3f6f1e72790 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1449,6 +1449,7 @@ static int soc_post_component_init(struct snd_soc_card *card,
1449 rtd = &card->rtd_aux[num]; 1449 rtd = &card->rtd_aux[num];
1450 name = aux_dev->name; 1450 name = aux_dev->name;
1451 } 1451 }
1452 rtd->card = card;
1452 1453
1453 /* machine controls, routes and widgets are not prefixed */ 1454 /* machine controls, routes and widgets are not prefixed */
1454 temp = codec->name_prefix; 1455 temp = codec->name_prefix;
@@ -1471,7 +1472,6 @@ static int soc_post_component_init(struct snd_soc_card *card,
1471 1472
1472 /* register the rtd device */ 1473 /* register the rtd device */
1473 rtd->codec = codec; 1474 rtd->codec = codec;
1474 rtd->card = card;
1475 rtd->dev.parent = card->dev; 1475 rtd->dev.parent = card->dev;
1476 rtd->dev.release = rtd_release; 1476 rtd->dev.release = rtd_release;
1477 rtd->dev.init_name = name; 1477 rtd->dev.init_name = name;