Commit 9ecb2406 authored by Markus Elfring's avatar Markus Elfring Committed by Takashi Iwai

ALSA: usb: Delete an error message for a failed memory allocation in two functions

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdfSigned-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6fd9ff7b
...@@ -146,10 +146,9 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip, ...@@ -146,10 +146,9 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
unsigned *rate_table = NULL; unsigned *rate_table = NULL;
fp = kmemdup(quirk->data, sizeof(*fp), GFP_KERNEL); fp = kmemdup(quirk->data, sizeof(*fp), GFP_KERNEL);
if (!fp) { if (!fp)
usb_audio_err(chip, "cannot memdup\n");
return -ENOMEM; return -ENOMEM;
}
INIT_LIST_HEAD(&fp->list); INIT_LIST_HEAD(&fp->list);
if (fp->nr_rates > MAX_NR_RATES) { if (fp->nr_rates > MAX_NR_RATES) {
kfree(fp); kfree(fp);
......
...@@ -658,10 +658,8 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) ...@@ -658,10 +658,8 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no)
continue; continue;
fp = kzalloc(sizeof(*fp), GFP_KERNEL); fp = kzalloc(sizeof(*fp), GFP_KERNEL);
if (! fp) { if (!fp)
dev_err(&dev->dev, "cannot malloc\n");
return -ENOMEM; return -ENOMEM;
}
fp->iface = iface_no; fp->iface = iface_no;
fp->altsetting = altno; fp->altsetting = altno;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment