aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2014-05-24 04:58:17 -0400
committerTakashi Iwai <tiwai@suse.de>2014-05-25 03:09:01 -0400
commita860d95f74025c6badbbdab6154c4ca15171927e (patch)
tree506651f751d462afa72062d1d4164ce0c98a6a10 /sound/usb
parent6bc170e4e8ac439c75153c0a03c736e37cf9f9a4 (diff)
ALSA: snd-usb: mixer: remove error messages on failed kmalloc()
If kmalloc() fails, warnings will be loud enough. We can safely just return -ENOMEM in such cases. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/mixer.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 9765e1cbe63b..0b728d886f0d 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1229,10 +1229,8 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
1229 return; 1229 return;
1230 1230
1231 cval = kzalloc(sizeof(*cval), GFP_KERNEL); 1231 cval = kzalloc(sizeof(*cval), GFP_KERNEL);
1232 if (!cval) { 1232 if (!cval)
1233 usb_audio_err(state->chip, "cannot malloc kcontrol\n");
1234 return; 1233 return;
1235 }
1236 cval->mixer = state->mixer; 1234 cval->mixer = state->mixer;
1237 cval->id = unitid; 1235 cval->id = unitid;
1238 cval->control = control; 1236 cval->control = control;
@@ -1815,10 +1813,8 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
1815 if (check_ignored_ctl(map)) 1813 if (check_ignored_ctl(map))
1816 continue; 1814 continue;
1817 cval = kzalloc(sizeof(*cval), GFP_KERNEL); 1815 cval = kzalloc(sizeof(*cval), GFP_KERNEL);
1818 if (!cval) { 1816 if (!cval)
1819 usb_audio_err(state->chip, "cannot malloc kcontrol\n");
1820 return -ENOMEM; 1817 return -ENOMEM;
1821 }
1822 cval->mixer = state->mixer; 1818 cval->mixer = state->mixer;
1823 cval->id = unitid; 1819 cval->id = unitid;
1824 cval->control = valinfo->control; 1820 cval->control = valinfo->control;
@@ -1849,7 +1845,6 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
1849 1845
1850 kctl = snd_ctl_new1(&mixer_procunit_ctl, cval); 1846 kctl = snd_ctl_new1(&mixer_procunit_ctl, cval);
1851 if (!kctl) { 1847 if (!kctl) {
1852 usb_audio_err(state->chip, "cannot malloc kcontrol\n");
1853 kfree(cval); 1848 kfree(cval);
1854 return -ENOMEM; 1849 return -ENOMEM;
1855 } 1850 }
@@ -2028,10 +2023,8 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid,
2028 return 0; 2023 return 0;
2029 2024
2030 cval = kzalloc(sizeof(*cval), GFP_KERNEL); 2025 cval = kzalloc(sizeof(*cval), GFP_KERNEL);
2031 if (!cval) { 2026 if (!cval)
2032 usb_audio_err(state->chip, "cannot malloc kcontrol\n");
2033 return -ENOMEM; 2027 return -ENOMEM;
2034 }
2035 cval->mixer = state->mixer; 2028 cval->mixer = state->mixer;
2036 cval->id = unitid; 2029 cval->id = unitid;
2037 cval->val_type = USB_MIXER_U8; 2030 cval->val_type = USB_MIXER_U8;
@@ -2048,7 +2041,6 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid,
2048 2041
2049 namelist = kmalloc(sizeof(char *) * desc->bNrInPins, GFP_KERNEL); 2042 namelist = kmalloc(sizeof(char *) * desc->bNrInPins, GFP_KERNEL);
2050 if (!namelist) { 2043 if (!namelist) {
2051 usb_audio_err(state->chip, "cannot malloc\n");
2052 kfree(cval); 2044 kfree(cval);
2053 return -ENOMEM; 2045 return -ENOMEM;
2054 } 2046 }
@@ -2058,7 +2050,6 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid,
2058 len = 0; 2050 len = 0;
2059 namelist[i] = kmalloc(MAX_ITEM_NAME_LEN, GFP_KERNEL); 2051 namelist[i] = kmalloc(MAX_ITEM_NAME_LEN, GFP_KERNEL);
2060 if (!namelist[i]) { 2052 if (!namelist[i]) {
2061 usb_audio_err(state->chip, "cannot malloc\n");
2062 while (i--) 2053 while (i--)
2063 kfree(namelist[i]); 2054 kfree(namelist[i]);
2064 kfree(namelist); 2055 kfree(namelist);