patch-2.1.70 linux/drivers/sound/lowlevel/awe_wave.c

Next file: linux/fs/Config.in
Previous file: linux/drivers/scsi/sr_vendor.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.69/linux/drivers/sound/lowlevel/awe_wave.c linux/drivers/sound/lowlevel/awe_wave.c
@@ -551,13 +551,17 @@
 	INIT_TABLE(samples, max_samples, AWE_MAX_SAMPLES, awe_sample_list);
 	INIT_TABLE(infos, max_infos, AWE_MAX_INFOS, awe_voice_list);
 
-	if ((my_dev=sound_alloc_synthdev())!=-1)
+	my_dev = sound_alloc_synthdev();
+	if (my_dev == -1) {
+		my_free(voices);
+		my_free(channels);
 		printk(KERN_WARNING "AWE32 Error: too many synthesizers\n");
-	else {
-		voice_alloc = &awe_operations.alloc;
-		voice_alloc->max_voice = awe_max_voices;
-		synth_devs[my_dev] = &awe_operations;
+		return 0;
 	}
+
+	voice_alloc = &awe_operations.alloc;
+	voice_alloc->max_voice = awe_max_voices;
+	synth_devs[my_dev] = &awe_operations;
 
 #ifdef CONFIG_AWE32_MIXER
 	if ((my_mixerdev=sound_alloc_mixerdev())!=-1) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov