ALSA: usb: Delete an error message for a failed memory allocation in two functions
Subsystems (2)
PATCH 1/1 ALSA: usb: Delete an error message for a failed memory allocation in two functions
From: Markus Elfring <[email protected]>
Date: Fri, 11 Aug 2017 18:38:25 +0200
Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- sound/usb/quirks.c | 5 ++--- sound/usb/stream.c | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-)
sound/usb/quirks.c +2 -3
@@ -146,10 +146,9 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,unsigned *rate_table =NULL ; fp =kmemdup (quirk->data,sizeof (*fp),GFP_KERNEL ); -if (!fp) { -usb_audio_err (chip,"cannot memdup\n" ); +if (!fp)return -ENOMEM ; - } +INIT_LIST_HEAD (&fp->list);if (fp->nr_rates >MAX_NR_RATES ) {kfree (fp);
sound/usb/stream.c +1 -3
@@ -658,10 +658,8 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no)continue ; fp =kzalloc (sizeof (*fp),GFP_KERNEL ); -if (! fp) { -dev_err (&dev->dev,"cannot malloc\n" ); +if (!fp)return -ENOMEM ; - } fp->iface = iface_no; fp->altsetting = altno;
Signature · 1 line
2.14.0
Takashi Iwai
AppliedQuoted 10 lines · SF Markus Elfring
From: Markus Elfring <[email protected]>
Date: Fri, 11 Aug 2017 18:38:25 +0200Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Applied, thanks.
Takashi