Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 873bd4cb authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ASoC: Don't set invalid name string to snd_card->driver field



The snd_card->driver field contains a driver name string, and in
general it shouldn't contain space or special letters.  The commit
2b39535b changed the string copy from
card->name, but the long name string may contain such letters, thus
it may still lead to a segfault.

A temporary fix is not to copy the long name string but just keep it
empty as the earlier version did.

Reported-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8d9afa08
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1929,8 +1929,9 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
		 "%s", card->name);
	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 ? card->driver_name : card->name);
	if (card->driver_name)
		strlcpy(card->snd_card->driver, card->driver_name,
			sizeof(card->snd_card->driver));

	if (card->late_probe) {
		ret = card->late_probe(card);