aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorJarkko Nikula <jhnikula@gmail.com>2011-05-20 08:47:40 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-21 22:31:11 -0400
commit2b39535b9e54888649923beaab443af212b6c0fd (patch)
tree0b4e42916a78e943a6ff15fc414f108fd9b1bfb5 /sound/soc/soc-core.c
parent0dfe8da4921fdae6b9c77e320731e490d4b15a99 (diff)
ASoC: core: Don't set "(null)" as a driver name
Commit 22de71b ("ASoC: core - allow ASoC more flexible machine name") writes "(null)" to driver name string in struct snd_card if card->driver_name is NULL. This causes segmentation faults with some user space ALSA utilities like aplay and arecord. Fix this by using the card->name if no driver name is specified. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-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 5968745213f8..bb7cd5812945 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1930,7 +1930,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
1930 snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), 1930 snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
1931 "%s", card->long_name ? card->long_name : card->name); 1931 "%s", card->long_name ? card->long_name : card->name);
1932 snprintf(card->snd_card->driver, sizeof(card->snd_card->driver), 1932 snprintf(card->snd_card->driver, sizeof(card->snd_card->driver),
1933 "%s", card->driver_name); 1933 "%s", card->driver_name ? card->driver_name : card->name);
1934 1934
1935 if (card->late_probe) { 1935 if (card->late_probe) {
1936 ret = card->late_probe(card); 1936 ret = card->late_probe(card);