ALSA: seq_oss: Drop superfluous error/debug messages after malloc failures
authorTakashi Iwai <tiwai@suse.de>
Tue, 10 Mar 2015 14:39:55 +0000 (15:39 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 10 Mar 2015 14:39:55 +0000 (15:39 +0100)
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>
sound/core/seq/oss/seq_oss_init.c
sound/core/seq/oss/seq_oss_midi.c
sound/core/seq/oss/seq_oss_readq.c
sound/core/seq/oss/seq_oss_synth.c

index b0e32e161dd187564e7d869d12651f2241eddd07..2de3feff70d06d275a824101829a4b3f1064e781 100644 (file)
@@ -188,10 +188,8 @@ snd_seq_oss_open(struct file *file, int level)
        struct seq_oss_devinfo *dp;
 
        dp = kzalloc(sizeof(*dp), GFP_KERNEL);
-       if (!dp) {
-               pr_err("ALSA: seq_oss: can't malloc device info\n");
+       if (!dp)
                return -ENOMEM;
-       }
 
        dp->cseq = system_client;
        dp->port = -1;
index e79cc44b1394e68c07d8eab6c00c3868522f8c03..96e8395ae5863e85a9e4a59c2ca870f9481de141 100644 (file)
@@ -173,10 +173,9 @@ snd_seq_oss_midi_check_new_port(struct snd_seq_port_info *pinfo)
        /*
         * allocate midi info record
         */
-       if ((mdev = kzalloc(sizeof(*mdev), GFP_KERNEL)) == NULL) {
-               pr_err("ALSA: seq_oss: can't malloc midi info\n");
+       mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
+       if (!mdev)
                return -ENOMEM;
-       }
 
        /* copy the port information */
        mdev->client = pinfo->addr.client;
index 654d17a5023c8a23e2ec5f799298d91dc0c7f457..c080c73cea04a258599fe58cd60473cfab77e1fc 100644 (file)
@@ -47,13 +47,12 @@ snd_seq_oss_readq_new(struct seq_oss_devinfo *dp, int maxlen)
 {
        struct seq_oss_readq *q;
 
-       if ((q = kzalloc(sizeof(*q), GFP_KERNEL)) == NULL) {
-               pr_err("ALSA: seq_oss: can't malloc read queue\n");
+       q = kzalloc(sizeof(*q), GFP_KERNEL);
+       if (!q)
                return NULL;
-       }
 
-       if ((q->q = kcalloc(maxlen, sizeof(union evrec), GFP_KERNEL)) == NULL) {
-               pr_err("ALSA: seq_oss: can't malloc read queue buffer\n");
+       q->q = kcalloc(maxlen, sizeof(union evrec), GFP_KERNEL);
+       if (!q->q) {
                kfree(q);
                return NULL;
        }
index 835edc80f9186fdcdb269fc455f540d8b3f68a76..48e4fe1b68abba6e2dcb25c365a82d04c647e8c7 100644 (file)
@@ -106,10 +106,9 @@ snd_seq_oss_synth_probe(struct device *_dev)
        struct snd_seq_oss_reg *reg = SNDRV_SEQ_DEVICE_ARGPTR(dev);
        unsigned long flags;
 
-       if ((rec = kzalloc(sizeof(*rec), GFP_KERNEL)) == NULL) {
-               pr_err("ALSA: seq_oss: can't malloc synth info\n");
+       rec = kzalloc(sizeof(*rec), GFP_KERNEL);
+       if (!rec)
                return -ENOMEM;
-       }
        rec->seq_device = -1;
        rec->synth_type = reg->type;
        rec->synth_subtype = reg->subtype;
@@ -249,7 +248,6 @@ snd_seq_oss_synth_setup(struct seq_oss_devinfo *dp)
                if (info->nr_voices > 0) {
                        info->ch = kcalloc(info->nr_voices, sizeof(struct seq_oss_chinfo), GFP_KERNEL);
                        if (!info->ch) {
-                               pr_err("ALSA: seq_oss: Cannot malloc voices\n");
                                rec->oper.close(&info->arg);
                                module_put(rec->oper.owner);
                                snd_use_lock_free(&rec->use_lock);