Skip to contentSkip to conversation

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

PATCH Applied SF Markus Elfring 2 participants 2 messages Aug 11, 2017 – Aug 12, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: usx2y: Delete an error message for a failed memory allocation in two functions

From: Markus Elfring <[email protected]>
Date: Fri, 11 Aug 2017 17:40:57 +0200

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

This issue was detected by using the Coccinelle software.

---
 sound/usb/usx2y/usbusx2yaudio.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
sound/usb/usx2y/usbusx2yaudio.c +3 -6
index dd40ca9d858a..612aa7ff7e18 100644
@@ -422,7 +422,5 @@ static int usX2Y_urbs_allocate(struct snd_usX2Y_substream *subs)
-		if (NULL = subs->tmpbuf) {
-			snd_printk(KERN_ERR "cannot malloc tmpbuf\n");
+		if (!subs->tmpbuf)
 			return -ENOMEM;
-		}
 	}
 	/* allocate and initialize data urbs */
 	for (i = 0; i < NRURBS; i++) {
@@ -952,7 +950,6 @@ static int usX2Y_audio_stream_new(struct snd_card *card, int playback_endpoint,
-		if (NULL = usX2Y_substream[i]) {
-			snd_printk(KERN_ERR "cannot malloc\n");
+		if (!usX2Y_substream[i])
 			return -ENOMEM;
-		}
+
 		usX2Y_substream[i]->usX2Y = usX2Y(card);
 	}
 
Signature · 1 line
2.14.0