summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-08-09 03:30:34 -0400
committerTakashi Iwai <tiwai@suse.de>2017-08-10 11:55:13 -0400
commit64a591e67e30599bed0179f187e034cc0828010e (patch)
tree0f010116df51fc4601fbc29de8117e23bb0d0496
parentfbc020b48c85fc7e4ca42ceb095c76f294b00043 (diff)
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>
-rw-r--r--sound/synth/emux/emux_seq.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index fd6cbd439511..396c406d0f77 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -145,14 +145,12 @@ snd_emux_create_port(struct snd_emux *emu, char *name,
145 145
146 /* Allocate structures for this channel */ 146 /* Allocate structures for this channel */
147 p = kzalloc(sizeof(*p), GFP_KERNEL); 147 p = kzalloc(sizeof(*p), GFP_KERNEL);
148 if (!p) { 148 if (!p)
149 snd_printk(KERN_ERR "no memory\n");
150 return NULL; 149 return NULL;
151 } 150
152 p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels), 151 p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels),
153 GFP_KERNEL); 152 GFP_KERNEL);
154 if (!p->chset.channels) { 153 if (!p->chset.channels) {
155 snd_printk(KERN_ERR "no memory\n");
156 kfree(p); 154 kfree(p);
157 return NULL; 155 return NULL;
158 } 156 }