]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ALSA] seq-oss - Remove invalid BUG()
authorTakashi Iwai <tiwai@suse.de>
Thu, 21 Feb 2008 11:40:00 +0000 (12:40 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 24 Apr 2008 10:00:14 +0000 (12:00 +0200)
Removed invalid BUG() - the driver should handle the error case properly
rather than issuing BUG().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/oss/seq_oss_synth.c

index ab570a0a6183650105021644c9e988bb2ccdf64d..558dadbf45f12e39387573ca5566b8d31b5be562 100644 (file)
@@ -245,8 +245,13 @@ snd_seq_oss_synth_setup(struct seq_oss_devinfo *dp)
                info->nr_voices = rec->nr_voices;
                if (info->nr_voices > 0) {
                        info->ch = kcalloc(info->nr_voices, sizeof(struct seq_oss_chinfo), GFP_KERNEL);
-                       if (!info->ch)
-                               BUG();
+                       if (!info->ch) {
+                               snd_printk(KERN_ERR "Cannot malloc\n");
+                               rec->oper.close(&info->arg);
+                               module_put(rec->oper.owner);
+                               snd_use_lock_free(&rec->use_lock);
+                               continue;
+                       }
                        reset_channels(info);
                }
                debug_printk(("synth %d assigned\n", i));