diff options
Diffstat (limited to 'sound/usb/pcm.c')
-rw-r--r-- | sound/usb/pcm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 0220b0f335b9..0eed6115c2d4 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
@@ -695,6 +695,7 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime, | |||
695 | struct snd_usb_substream *subs) | 695 | struct snd_usb_substream *subs) |
696 | { | 696 | { |
697 | struct audioformat *fp; | 697 | struct audioformat *fp; |
698 | int *rate_list; | ||
698 | int count = 0, needs_knot = 0; | 699 | int count = 0, needs_knot = 0; |
699 | int err; | 700 | int err; |
700 | 701 | ||
@@ -708,7 +709,8 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime, | |||
708 | if (!needs_knot) | 709 | if (!needs_knot) |
709 | return 0; | 710 | return 0; |
710 | 711 | ||
711 | subs->rate_list.list = kmalloc(sizeof(int) * count, GFP_KERNEL); | 712 | subs->rate_list.list = rate_list = |
713 | kmalloc(sizeof(int) * count, GFP_KERNEL); | ||
712 | if (!subs->rate_list.list) | 714 | if (!subs->rate_list.list) |
713 | return -ENOMEM; | 715 | return -ENOMEM; |
714 | subs->rate_list.count = count; | 716 | subs->rate_list.count = count; |
@@ -717,7 +719,7 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime, | |||
717 | list_for_each_entry(fp, &subs->fmt_list, list) { | 719 | list_for_each_entry(fp, &subs->fmt_list, list) { |
718 | int i; | 720 | int i; |
719 | for (i = 0; i < fp->nr_rates; i++) | 721 | for (i = 0; i < fp->nr_rates; i++) |
720 | subs->rate_list.list[count++] = fp->rate_table[i]; | 722 | rate_list[count++] = fp->rate_table[i]; |
721 | } | 723 | } |
722 | err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, | 724 | err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, |
723 | &subs->rate_list); | 725 | &subs->rate_list); |