Skip to content

Commit 64a591e

Browse files
elfringtiwai
authored andcommitted
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.pdf Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent fbc020b commit 64a591e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎sound/synth/emux/emux_seq.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,12 @@ snd_emux_create_port(struct snd_emux *emu, char *name,
145145

146146
/* Allocate structures for this channel */
147147
p = kzalloc(sizeof(*p), GFP_KERNEL);
148-
if (!p) {
149-
snd_printk(KERN_ERR "no memory\n");
148+
if (!p)
150149
return NULL;
151-
}
150+
152151
p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels),
153152
GFP_KERNEL);
154153
if (!p->chset.channels) {
155-
snd_printk(KERN_ERR "no memory\n");
156154
kfree(p);
157155
return NULL;
158156
}

0 commit comments

Comments
 (0)