aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/usbaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/usbaudio.c')
-rw-r--r--sound/usb/usbaudio.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index f48838a078cb..5c40c031dd57 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -1762,8 +1762,10 @@ static int check_hw_params_convention(struct snd_usb_substream *subs)
1762 1762
1763 channels = kcalloc(MAX_MASK, sizeof(u32), GFP_KERNEL); 1763 channels = kcalloc(MAX_MASK, sizeof(u32), GFP_KERNEL);
1764 rates = kcalloc(MAX_MASK, sizeof(u32), GFP_KERNEL); 1764 rates = kcalloc(MAX_MASK, sizeof(u32), GFP_KERNEL);
1765 if (!channels || !rates) 1765 if (!channels || !rates) {
1766 err = -ENOMEM;
1766 goto __out; 1767 goto __out;
1768 }
1767 1769
1768 list_for_each(p, &subs->fmt_list) { 1770 list_for_each(p, &subs->fmt_list) {
1769 struct audioformat *f; 1771 struct audioformat *f;
@@ -1916,7 +1918,10 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
1916 1000 * MIN_PACKS_URB, 1918 1000 * MIN_PACKS_URB,
1917 /*(nrpacks * MAX_URBS) * 1000*/ UINT_MAX); 1919 /*(nrpacks * MAX_URBS) * 1000*/ UINT_MAX);
1918 1920
1919 if (check_hw_params_convention(subs)) { 1921 err = check_hw_params_convention(subs);
1922 if (err < 0)
1923 return err;
1924 else if (err) {
1920 hwc_debug("setting extra hw constraints...\n"); 1925 hwc_debug("setting extra hw constraints...\n");
1921 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 1926 if ((err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
1922 hw_rule_rate, subs, 1927 hw_rule_rate, subs,