From 2b39535b9e54888649923beaab443af212b6c0fd Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Fri, 20 May 2011 15:47:40 +0300 Subject: 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 Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), "%s", card->long_name ? card->long_name : card->name); 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) { ret = card->late_probe(card); -- cgit v1.2.3