Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120179
b: refs/heads/master
c: 219b93f
h: refs/heads/master
i:
  120177: 163d3fa
  120175: 53cdfda
v: v3
  • Loading branch information
Mark Brown committed Oct 30, 2008
1 parent 779dc94 commit 4e08a1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f24368c2fb524e911b831b86b5f0acfb38c70317
refs/heads/master: 219b93f5252086c8c8d647c77fc9e1377aab0c8d
11 changes: 8 additions & 3 deletions trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static int dapm_new_mixer(struct snd_soc_codec *codec,
struct snd_soc_dapm_widget *w)
{
int i, ret = 0;
char name[32];
size_t name_len;
struct snd_soc_dapm_path *path;

/* add kcontrol */
Expand All @@ -303,11 +303,16 @@ static int dapm_new_mixer(struct snd_soc_codec *codec,
continue;

/* add dapm control with long name */
snprintf(name, 32, "%s %s", w->name, w->kcontrols[i].name);
path->long_name = kstrdup (name, GFP_KERNEL);
name_len = 2 + strlen(w->name)
+ strlen(w->kcontrols[i].name);
path->long_name = kmalloc(name_len, GFP_KERNEL);
if (path->long_name == NULL)
return -ENOMEM;

snprintf(path->long_name, name_len, "%s %s",
w->name, w->kcontrols[i].name);
path->long_name[name_len - 1] = '\0';

path->kcontrol = snd_soc_cnew(&w->kcontrols[i], w,
path->long_name);
ret = snd_ctl_add(codec->card, path->kcontrol);
Expand Down

0 comments on commit 4e08a1e

Please sign in to comment.