Commit 2b39535b authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Mark Brown

ASoC: core: Don't set "(null)" as a driver name

Commit 22de71ba ("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: default avatarJarkko Nikula <jhnikula@gmail.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 0dfe8da4
...@@ -1930,7 +1930,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1930,7 +1930,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
"%s", card->long_name ? card->long_name : card->name); "%s", card->long_name ? card->long_name : card->name);
snprintf(card->snd_card->driver, sizeof(card->snd_card->driver), snprintf(card->snd_card->driver, sizeof(card->snd_card->driver),
"%s", card->driver_name); "%s", card->driver_name ? card->driver_name : card->name);
if (card->late_probe) { if (card->late_probe) {
ret = card->late_probe(card); ret = card->late_probe(card);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment