All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@ti.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>,
	"kuninori.morimoto.gx@renesas.com"
	<kuninori.morimoto.gx@renesas.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: ALSA become "Segmentation fault" on current linus tree
Date: Tue, 5 Jul 2011 11:22:33 +0100	[thread overview]
Message-ID: <4E12E5E9.7090605@ti.com> (raw)
In-Reply-To: <s5h7h7xfah0.wl%tiwai@suse.de>

On 05/07/11 08:33, Takashi Iwai wrote:
> At Tue, 05 Jul 2011 00:12:04 -0700 (PDT),
> kuninori.morimoto.gx@renesas.com wrote:
>>
>>
>> Dear Mark, Liam
>>
>> These are fsi-xxx card name fixup patches.
>> It are needed for current linus tree.
>>
>> Kuninori Morimoto (3):
>>       ASoC: sh: fsi-ak4642: fixup snd_soc_card name
>>       ASoC: sh: fsi-da7210: fixup snd_soc_card name
>>       ASoC: sh: fsi-hdmi: fixup snd_soc_card name
> 
> The name string itself is allowed to contain spaces or other special
> letters.  These are copied to longname and shortname.
> But the driver_name string isn't, and the problem is to reuse the same
> string for it.
> 
> Since no driver sets driver_name string yet, a better fix would be
> to keep it empty like the earlier version.  The revised patch below.
> 

I can give a little background here, the intention is to allow a single "family" driver to support several different machines. i.e. the Panda, Blaze and SDP4430 are use the same "OMAP4" sound driver, but all have slightly different analog outputs (requiring slightly different userspace alsa-lib/UCM configs).

I do have a patch queued using driver name for OMAP4, but that will be for 3.2. 

> 
> Takashi
> 
> ---
> From: Takashi Iwai <tiwai@suse.de>
> Subject: [PATCH] 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
> 2b39535b9e54888649923beaab443af212b6c0fd 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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

Acked-by: Liam Girdwood <lrg@ti.com>

> ---
>  sound/soc/soc-core.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index d75043e..b194be0 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -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);

  parent reply	other threads:[~2011-07-05 10:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05  4:10 ALSA become "Segmentation fault" on current linus tree kuninori.morimoto.gx
2011-07-05  5:41 ` Takashi Iwai
2011-07-05  5:57   ` kuninori.morimoto.gx
2011-07-05  6:06     ` Takashi Iwai
2011-07-05  6:08       ` kuninori.morimoto.gx
2011-07-05  6:07     ` kuninori.morimoto.gx
2011-07-05  6:19       ` Takashi Iwai
2011-07-05  6:29         ` kuninori.morimoto.gx
2011-07-05  6:33           ` Takashi Iwai
2011-07-05  6:52             ` kuninori.morimoto.gx
2011-07-05  7:12               ` kuninori.morimoto.gx
2011-07-05  7:15                 ` [PATCH 1/3] ASoC: sh: fsi-ak4642: fixup snd_soc_card name Kuninori Morimoto
2011-07-09 10:06                   ` Mark Brown
2011-07-05  7:16                 ` [PATCH 2/3] ASoC: sh: fsi-da7210: " Kuninori Morimoto
2011-07-05  7:16                 ` [PATCH 3/3] ASoC: sh: fsi-hdmi: " Kuninori Morimoto
2011-07-05  7:33                 ` ALSA become "Segmentation fault" on current linus tree Takashi Iwai
2011-07-05  8:11                   ` kuninori.morimoto.gx
2011-07-05 10:22                   ` Liam Girdwood [this message]
2011-07-05 12:41                     ` Takashi Iwai
2011-07-05 17:14                       ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E12E5E9.7090605@ti.com \
    --to=lrg@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=kuninori.morimoto.gx@gmail.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.