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>
This commit is contained in:
committed by
Takashi Iwai
parent
fbc020b48c
commit
64a591e67e
@@ -145,14 +145,12 @@ snd_emux_create_port(struct snd_emux *emu, char *name,
|
|||||||
|
|
||||||
/* Allocate structures for this channel */
|
/* Allocate structures for this channel */
|
||||||
p = kzalloc(sizeof(*p), GFP_KERNEL);
|
p = kzalloc(sizeof(*p), GFP_KERNEL);
|
||||||
if (!p) {
|
if (!p)
|
||||||
snd_printk(KERN_ERR "no memory\n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels),
|
p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!p->chset.channels) {
|
if (!p->chset.channels) {
|
||||||
snd_printk(KERN_ERR "no memory\n");
|
|
||||||
kfree(p);
|
kfree(p);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user