ALSA: seq_oss: 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:39:55 +01:00
parent 2225e79b9b
commit 8d98a0673f
4 changed files with 9 additions and 15 deletions

View File

@ -188,10 +188,8 @@ snd_seq_oss_open(struct file *file, int level)
struct seq_oss_devinfo *dp; struct seq_oss_devinfo *dp;
dp = kzalloc(sizeof(*dp), GFP_KERNEL); dp = kzalloc(sizeof(*dp), GFP_KERNEL);
if (!dp) { if (!dp)
pr_err("ALSA: seq_oss: can't malloc device info\n");
return -ENOMEM; return -ENOMEM;
}
dp->cseq = system_client; dp->cseq = system_client;
dp->port = -1; dp->port = -1;

View File

@ -173,10 +173,9 @@ snd_seq_oss_midi_check_new_port(struct snd_seq_port_info *pinfo)
/* /*
* allocate midi info record * allocate midi info record
*/ */
if ((mdev = kzalloc(sizeof(*mdev), GFP_KERNEL)) == NULL) { mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
pr_err("ALSA: seq_oss: can't malloc midi info\n"); if (!mdev)
return -ENOMEM; return -ENOMEM;
}
/* copy the port information */ /* copy the port information */
mdev->client = pinfo->addr.client; mdev->client = pinfo->addr.client;

View File

@ -47,13 +47,12 @@ snd_seq_oss_readq_new(struct seq_oss_devinfo *dp, int maxlen)
{ {
struct seq_oss_readq *q; struct seq_oss_readq *q;
if ((q = kzalloc(sizeof(*q), GFP_KERNEL)) == NULL) { q = kzalloc(sizeof(*q), GFP_KERNEL);
pr_err("ALSA: seq_oss: can't malloc read queue\n"); if (!q)
return NULL; return NULL;
}
if ((q->q = kcalloc(maxlen, sizeof(union evrec), GFP_KERNEL)) == NULL) { q->q = kcalloc(maxlen, sizeof(union evrec), GFP_KERNEL);
pr_err("ALSA: seq_oss: can't malloc read queue buffer\n"); if (!q->q) {
kfree(q); kfree(q);
return NULL; return NULL;
} }

View File

@ -106,10 +106,9 @@ snd_seq_oss_synth_probe(struct device *_dev)
struct snd_seq_oss_reg *reg = SNDRV_SEQ_DEVICE_ARGPTR(dev); struct snd_seq_oss_reg *reg = SNDRV_SEQ_DEVICE_ARGPTR(dev);
unsigned long flags; unsigned long flags;
if ((rec = kzalloc(sizeof(*rec), GFP_KERNEL)) == NULL) { rec = kzalloc(sizeof(*rec), GFP_KERNEL);
pr_err("ALSA: seq_oss: can't malloc synth info\n"); if (!rec)
return -ENOMEM; return -ENOMEM;
}
rec->seq_device = -1; rec->seq_device = -1;
rec->synth_type = reg->type; rec->synth_type = reg->type;
rec->synth_subtype = reg->subtype; rec->synth_subtype = reg->subtype;
@ -249,7 +248,6 @@ snd_seq_oss_synth_setup(struct seq_oss_devinfo *dp)
if (info->nr_voices > 0) { if (info->nr_voices > 0) {
info->ch = kcalloc(info->nr_voices, sizeof(struct seq_oss_chinfo), GFP_KERNEL); info->ch = kcalloc(info->nr_voices, sizeof(struct seq_oss_chinfo), GFP_KERNEL);
if (!info->ch) { if (!info->ch) {
pr_err("ALSA: seq_oss: Cannot malloc voices\n");
rec->oper.close(&info->arg); rec->oper.close(&info->arg);
module_put(rec->oper.owner); module_put(rec->oper.owner);
snd_use_lock_free(&rec->use_lock); snd_use_lock_free(&rec->use_lock);