ALSA: core: Drop superfluous error/debug messages after malloc failures

The kernel memory allocators already report the errors when the
requested allocation fails, thus we don't need to warn it again in
each caller side.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2015-03-10 15:42:14 +01:00
parent 24db8bbaa3
commit ec0e9937aa
8 changed files with 10 additions and 32 deletions

View File

@@ -343,11 +343,8 @@ static void snd_pcm_proc_info_read(struct snd_pcm_substream *substream,
return;
info = kmalloc(sizeof(*info), GFP_KERNEL);
if (! info) {
pcm_dbg(substream->pcm,
"snd_pcm_proc_info_read: cannot malloc\n");
if (!info)
return;
}
err = snd_pcm_info(substream, info);
if (err < 0) {
@@ -717,10 +714,8 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count)
prev = NULL;
for (idx = 0, prev = NULL; idx < substream_count; idx++) {
substream = kzalloc(sizeof(*substream), GFP_KERNEL);
if (substream == NULL) {
pcm_err(pcm, "Cannot allocate PCM substream\n");
if (!substream)
return -ENOMEM;
}
substream->pcm = pcm;
substream->pstr = pstr;
substream->number = idx;
@@ -774,10 +769,8 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device,
if (rpcm)
*rpcm = NULL;
pcm = kzalloc(sizeof(*pcm), GFP_KERNEL);
if (pcm == NULL) {
dev_err(card->dev, "Cannot allocate PCM\n");
if (!pcm)
return -ENOMEM;
}
pcm->card = card;
pcm->device = device;
pcm->internal = internal;