Commit 64a591e6 authored by Markus Elfring's avatar Markus Elfring Committed by Takashi Iwai

ALSA: emux: Delete two error messages for a failed memory allocation in snd_emux_create_port()

Omit extra messages for a memory allocation failure in this function.

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 fbc020b4
......@@ -145,14 +145,12 @@ snd_emux_create_port(struct snd_emux *emu, char *name,
/* Allocate structures for this channel */
p = kzalloc(sizeof(*p), GFP_KERNEL);
if (!p) {
snd_printk(KERN_ERR "no memory\n");
if (!p)
return NULL;
}
p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels),
GFP_KERNEL);
if (!p->chset.channels) {
snd_printk(KERN_ERR "no memory\n");
kfree(p);
return NULL;
}
......
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