diff options
Diffstat (limited to 'sound/drivers')
-rw-r--r-- | sound/drivers/dummy.c | 4 | ||||
-rw-r--r-- | sound/drivers/mpu401/mpu401.c | 4 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_lib.c | 2 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_oss.c | 12 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_seq.c | 22 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_synth.c | 10 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_lib.c | 2 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_local.h | 2 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_proc.c | 10 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_seq.c | 12 | ||||
-rw-r--r-- | sound/drivers/serial-u16550.c | 5 | ||||
-rw-r--r-- | sound/drivers/virmidi.c | 4 | ||||
-rw-r--r-- | sound/drivers/vx/vx_core.c | 2 | ||||
-rw-r--r-- | sound/drivers/vx/vx_mixer.c | 72 | ||||
-rw-r--r-- | sound/drivers/vx/vx_pcm.c | 13 |
15 files changed, 98 insertions, 78 deletions
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 14e1a671b5c..e35fd5779a9 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -669,8 +669,10 @@ static int __init alsa_card_dummy_init(void) return err; cards = 0; - for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { + for (i = 0; i < SNDRV_CARDS; i++) { struct platform_device *device; + if (! enable[i]) + continue; device = platform_device_register_simple(SND_DUMMY_DRIVER, i, NULL, 0); if (IS_ERR(device)) { diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index 915589a402a..9d10d79e27a 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c @@ -240,8 +240,10 @@ static int __init alsa_card_mpu401_init(void) return err; devices = 0; - for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { + for (i = 0; i < SNDRV_CARDS; i++) { struct platform_device *device; + if (! enable[i]) + continue; #ifdef CONFIG_PNP if (pnp[i]) continue; diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c index 1e0c76b9acf..4f855697677 100644 --- a/sound/drivers/opl3/opl3_lib.c +++ b/sound/drivers/opl3/opl3_lib.c @@ -358,7 +358,7 @@ int snd_opl3_new(struct snd_card *card, opl3->hardware = hardware; spin_lock_init(&opl3->reg_lock); spin_lock_init(&opl3->timer_lock); - init_MUTEX(&opl3->access_mutex); + mutex_init(&opl3->access_mutex); if ((err = snd_device_new(card, SNDRV_DEV_CODEC, opl3, &ops)) < 0) { snd_opl3_free(opl3); diff --git a/sound/drivers/opl3/opl3_oss.c b/sound/drivers/opl3/opl3_oss.c index 0345ae64768..fccf019a6d8 100644 --- a/sound/drivers/opl3/opl3_oss.c +++ b/sound/drivers/opl3/opl3_oss.c @@ -104,8 +104,10 @@ static int snd_opl3_oss_create_port(struct snd_opl3 * opl3) voices, voices, name); if (opl3->oss_chset->port < 0) { + int port; + port = opl3->oss_chset->port; snd_midi_channel_free_set(opl3->oss_chset); - return opl3->oss_chset->port; + return port; } return 0; } @@ -136,10 +138,10 @@ void snd_opl3_init_seq_oss(struct snd_opl3 *opl3, char *name) arg->oper = oss_callback; arg->private_data = opl3; - snd_opl3_oss_create_port(opl3); - - /* register to OSS synth table */ - snd_device_register(opl3->card, dev); + if (snd_opl3_oss_create_port(opl3)) { + /* register to OSS synth table */ + snd_device_register(opl3->card, dev); + } } /* unregister */ diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c index c4ead790008..57becf34f43 100644 --- a/sound/drivers/opl3/opl3_seq.c +++ b/sound/drivers/opl3/opl3_seq.c @@ -52,13 +52,13 @@ int snd_opl3_synth_setup(struct snd_opl3 * opl3) { int idx; - down(&opl3->access_mutex); + mutex_lock(&opl3->access_mutex); if (opl3->used) { - up(&opl3->access_mutex); + mutex_unlock(&opl3->access_mutex); return -EBUSY; } opl3->used++; - up(&opl3->access_mutex); + mutex_unlock(&opl3->access_mutex); snd_opl3_reset(opl3); @@ -91,9 +91,9 @@ void snd_opl3_synth_cleanup(struct snd_opl3 * opl3) spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); snd_opl3_reset(opl3); - down(&opl3->access_mutex); + mutex_lock(&opl3->access_mutex); opl3->used--; - up(&opl3->access_mutex); + mutex_unlock(&opl3->access_mutex); } static int snd_opl3_synth_use(void *private_data, struct snd_seq_port_subscribe * info) @@ -207,8 +207,10 @@ static int snd_opl3_synth_create_port(struct snd_opl3 * opl3) 16, voices, name); if (opl3->chset->port < 0) { + int port; + port = opl3->chset->port; snd_midi_channel_free_set(opl3->chset); - return opl3->chset->port; + return port; } return 0; } @@ -218,7 +220,7 @@ static int snd_opl3_synth_create_port(struct snd_opl3 * opl3) static int snd_opl3_seq_new_device(struct snd_seq_device *dev) { struct snd_opl3 *opl3; - int client; + int client, err; char name[32]; int opl_ver; @@ -239,7 +241,11 @@ static int snd_opl3_seq_new_device(struct snd_seq_device *dev) if (client < 0) return client; - snd_opl3_synth_create_port(opl3); + if ((err = snd_opl3_synth_create_port(opl3)) < 0) { + snd_seq_delete_kernel_client(client); + opl3->seq_client = -1; + return err; + } /* initialize instrument list */ opl3->ilist = snd_seq_instr_list_new(); diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c index 3534a0e3342..6db503f025b 100644 --- a/sound/drivers/opl3/opl3_synth.c +++ b/sound/drivers/opl3/opl3_synth.c @@ -76,13 +76,13 @@ int snd_opl3_open(struct snd_hwdep * hw, struct file *file) { struct snd_opl3 *opl3 = hw->private_data; - down(&opl3->access_mutex); + mutex_lock(&opl3->access_mutex); if (opl3->used) { - up(&opl3->access_mutex); + mutex_unlock(&opl3->access_mutex); return -EAGAIN; } opl3->used++; - up(&opl3->access_mutex); + mutex_unlock(&opl3->access_mutex); return 0; } @@ -179,9 +179,9 @@ int snd_opl3_release(struct snd_hwdep * hw, struct file *file) struct snd_opl3 *opl3 = hw->private_data; snd_opl3_reset(opl3); - down(&opl3->access_mutex); + mutex_lock(&opl3->access_mutex); opl3->used--; - up(&opl3->access_mutex); + mutex_unlock(&opl3->access_mutex); return 0; } diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c index ddfc10d04be..4bc860ae02d 100644 --- a/sound/drivers/opl4/opl4_lib.c +++ b/sound/drivers/opl4/opl4_lib.c @@ -214,7 +214,7 @@ int snd_opl4_create(struct snd_card *card, opl4->fm_port = fm_port; opl4->pcm_port = pcm_port; spin_lock_init(&opl4->reg_lock); - init_MUTEX(&opl4->access_mutex); + mutex_init(&opl4->access_mutex); err = snd_opl4_detect(opl4); if (err < 0) { diff --git a/sound/drivers/opl4/opl4_local.h b/sound/drivers/opl4/opl4_local.h index 7e088a4a2f4..470e5a758a0 100644 --- a/sound/drivers/opl4/opl4_local.h +++ b/sound/drivers/opl4/opl4_local.h @@ -182,7 +182,7 @@ struct snd_opl4 { struct snd_info_entry *proc_entry; int memory_access; #endif - struct semaphore access_mutex; + struct mutex access_mutex; #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) int used; diff --git a/sound/drivers/opl4/opl4_proc.c b/sound/drivers/opl4/opl4_proc.c index f4b4e74fcc1..e552ec34166 100644 --- a/sound/drivers/opl4/opl4_proc.c +++ b/sound/drivers/opl4/opl4_proc.c @@ -28,13 +28,13 @@ static int snd_opl4_mem_proc_open(struct snd_info_entry *entry, { struct snd_opl4 *opl4 = entry->private_data; - down(&opl4->access_mutex); + mutex_lock(&opl4->access_mutex); if (opl4->memory_access) { - up(&opl4->access_mutex); + mutex_unlock(&opl4->access_mutex); return -EBUSY; } opl4->memory_access++; - up(&opl4->access_mutex); + mutex_unlock(&opl4->access_mutex); return 0; } @@ -43,9 +43,9 @@ static int snd_opl4_mem_proc_release(struct snd_info_entry *entry, { struct snd_opl4 *opl4 = entry->private_data; - down(&opl4->access_mutex); + mutex_lock(&opl4->access_mutex); opl4->memory_access--; - up(&opl4->access_mutex); + mutex_unlock(&opl4->access_mutex); return 0; } diff --git a/sound/drivers/opl4/opl4_seq.c b/sound/drivers/opl4/opl4_seq.c index e3480326e73..dc0dcdc6c31 100644 --- a/sound/drivers/opl4/opl4_seq.c +++ b/sound/drivers/opl4/opl4_seq.c @@ -62,10 +62,10 @@ static int snd_opl4_seq_use(void *private_data, struct snd_seq_port_subscribe *i struct snd_opl4 *opl4 = private_data; int err; - down(&opl4->access_mutex); + mutex_lock(&opl4->access_mutex); if (opl4->used) { - up(&opl4->access_mutex); + mutex_unlock(&opl4->access_mutex); return -EBUSY; } opl4->used++; @@ -73,12 +73,12 @@ static int snd_opl4_seq_use(void *private_data, struct snd_seq_port_subscribe *i if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM) { err = snd_opl4_seq_use_inc(opl4); if (err < 0) { - up(&opl4->access_mutex); + mutex_unlock(&opl4->access_mutex); return err; } } - up(&opl4->access_mutex); + mutex_unlock(&opl4->access_mutex); snd_opl4_synth_reset(opl4); return 0; @@ -90,9 +90,9 @@ static int snd_opl4_seq_unuse(void *private_data, struct snd_seq_port_subscribe snd_opl4_synth_shutdown(opl4); - down(&opl4->access_mutex); + mutex_lock(&opl4->access_mutex); opl4->used--; - up(&opl4->access_mutex); + mutex_unlock(&opl4->access_mutex); if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM) snd_opl4_seq_use_dec(opl4); diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 112ddf70540..1a7fbefe474 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c @@ -789,6 +789,7 @@ static int __init snd_uart16550_create(struct snd_card *card, if ((err = snd_uart16550_detect(uart)) <= 0) { printk(KERN_ERR "no UART detected at 0x%lx\n", iobase); + snd_uart16550_free(uart); return -ENODEV; } @@ -989,8 +990,10 @@ static int __init alsa_card_serial_init(void) return err; cards = 0; - for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { + for (i = 0; i < SNDRV_CARDS; i++) { struct platform_device *device; + if (! enable[i]) + continue; device = platform_device_register_simple(SND_SERIAL_DRIVER, i, NULL, 0); if (IS_ERR(device)) { diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index 4258723de2a..a3ee306239c 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c @@ -163,8 +163,10 @@ static int __init alsa_card_virmidi_init(void) return err; cards = 0; - for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { + for (i = 0; i < SNDRV_CARDS; i++) { struct platform_device *device; + if (! enable[i]) + continue; device = platform_device_register_simple(SND_VIRMIDI_DRIVER, i, NULL, 0); if (IS_ERR(device)) { diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index 43f615d7a54..fa4a2b5c2d8 100644 --- a/sound/drivers/vx/vx_core.c +++ b/sound/drivers/vx/vx_core.c @@ -778,7 +778,7 @@ struct vx_core *snd_vx_create(struct snd_card *card, struct snd_vx_hardware *hw, chip->type = hw->type; chip->ops = ops; tasklet_init(&chip->tq, vx_interrupt, (unsigned long)chip); - init_MUTEX(&chip->mixer_mutex); + mutex_init(&chip->mixer_mutex); chip->card = card; card->private_data = chip; diff --git a/sound/drivers/vx/vx_mixer.c b/sound/drivers/vx/vx_mixer.c index 8ec2c605d2f..c1d7fcdd197 100644 --- a/sound/drivers/vx/vx_mixer.c +++ b/sound/drivers/vx/vx_mixer.c @@ -427,10 +427,10 @@ static int vx_output_level_get(struct snd_kcontrol *kcontrol, struct snd_ctl_ele { struct vx_core *chip = snd_kcontrol_chip(kcontrol); int codec = kcontrol->id.index; - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); ucontrol->value.integer.value[0] = chip->output_level[codec][0]; ucontrol->value.integer.value[1] = chip->output_level[codec][1]; - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -438,7 +438,7 @@ static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele { struct vx_core *chip = snd_kcontrol_chip(kcontrol); int codec = kcontrol->id.index; - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); if (ucontrol->value.integer.value[0] != chip->output_level[codec][0] || ucontrol->value.integer.value[1] != chip->output_level[codec][1]) { vx_set_analog_output_level(chip, codec, @@ -446,10 +446,10 @@ static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele ucontrol->value.integer.value[1]); chip->output_level[codec][0] = ucontrol->value.integer.value[0]; chip->output_level[codec][1] = ucontrol->value.integer.value[1]; - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 1; } - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -502,14 +502,14 @@ static int vx_audio_src_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v static int vx_audio_src_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct vx_core *chip = snd_kcontrol_chip(kcontrol); - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); if (chip->audio_source_target != ucontrol->value.enumerated.item[0]) { chip->audio_source_target = ucontrol->value.enumerated.item[0]; vx_sync_audio_source(chip); - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 1; } - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -550,14 +550,14 @@ static int vx_clock_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ static int vx_clock_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct vx_core *chip = snd_kcontrol_chip(kcontrol); - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); if (chip->clock_mode != ucontrol->value.enumerated.item[0]) { chip->clock_mode = ucontrol->value.enumerated.item[0]; vx_set_clock(chip, chip->freq); - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 1; } - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -587,10 +587,10 @@ static int vx_audio_gain_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ int audio = kcontrol->private_value & 0xff; int capture = (kcontrol->private_value >> 8) & 1; - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); ucontrol->value.integer.value[0] = chip->audio_gain[capture][audio]; ucontrol->value.integer.value[1] = chip->audio_gain[capture][audio+1]; - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -600,15 +600,15 @@ static int vx_audio_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ int audio = kcontrol->private_value & 0xff; int capture = (kcontrol->private_value >> 8) & 1; - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); if (ucontrol->value.integer.value[0] != chip->audio_gain[capture][audio] || ucontrol->value.integer.value[1] != chip->audio_gain[capture][audio+1]) { vx_set_audio_gain(chip, audio, capture, ucontrol->value.integer.value[0]); vx_set_audio_gain(chip, audio+1, capture, ucontrol->value.integer.value[1]); - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 1; } - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -617,10 +617,10 @@ static int vx_audio_monitor_get(struct snd_kcontrol *kcontrol, struct snd_ctl_el struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); ucontrol->value.integer.value[0] = chip->audio_monitor[audio]; ucontrol->value.integer.value[1] = chip->audio_monitor[audio+1]; - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -629,17 +629,17 @@ static int vx_audio_monitor_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); if (ucontrol->value.integer.value[0] != chip->audio_monitor[audio] || ucontrol->value.integer.value[1] != chip->audio_monitor[audio+1]) { vx_set_monitor_level(chip, audio, ucontrol->value.integer.value[0], chip->audio_monitor_active[audio]); vx_set_monitor_level(chip, audio+1, ucontrol->value.integer.value[1], chip->audio_monitor_active[audio+1]); - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 1; } - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -657,10 +657,10 @@ static int vx_audio_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); ucontrol->value.integer.value[0] = chip->audio_active[audio]; ucontrol->value.integer.value[1] = chip->audio_active[audio+1]; - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -669,15 +669,15 @@ static int vx_audio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); if (ucontrol->value.integer.value[0] != chip->audio_active[audio] || ucontrol->value.integer.value[1] != chip->audio_active[audio+1]) { vx_set_audio_switch(chip, audio, ucontrol->value.integer.value[0]); vx_set_audio_switch(chip, audio+1, ucontrol->value.integer.value[1]); - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 1; } - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -686,10 +686,10 @@ static int vx_monitor_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); ucontrol->value.integer.value[0] = chip->audio_monitor_active[audio]; ucontrol->value.integer.value[1] = chip->audio_monitor_active[audio+1]; - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -698,17 +698,17 @@ static int vx_monitor_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); if (ucontrol->value.integer.value[0] != chip->audio_monitor_active[audio] || ucontrol->value.integer.value[1] != chip->audio_monitor_active[audio+1]) { vx_set_monitor_level(chip, audio, chip->audio_monitor[audio], ucontrol->value.integer.value[0]); vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1], ucontrol->value.integer.value[1]); - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 1; } - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -756,12 +756,12 @@ static int vx_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu { struct vx_core *chip = snd_kcontrol_chip(kcontrol); - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); ucontrol->value.iec958.status[0] = (chip->uer_bits >> 0) & 0xff; ucontrol->value.iec958.status[1] = (chip->uer_bits >> 8) & 0xff; ucontrol->value.iec958.status[2] = (chip->uer_bits >> 16) & 0xff; ucontrol->value.iec958.status[3] = (chip->uer_bits >> 24) & 0xff; - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } @@ -783,14 +783,14 @@ static int vx_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu (ucontrol->value.iec958.status[1] << 8) | (ucontrol->value.iec958.status[2] << 16) | (ucontrol->value.iec958.status[3] << 24); - down(&chip->mixer_mutex); + mutex_lock(&chip->mixer_mutex); if (chip->uer_bits != val) { chip->uer_bits = val; vx_set_iec958_status(chip, val); - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 1; } - up(&chip->mixer_mutex); + mutex_unlock(&chip->mixer_mutex); return 0; } diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index 464109e421d..c4af84995d0 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c @@ -98,10 +98,9 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs) { struct snd_pcm_runtime *runtime = subs->runtime; - if (runtime->dma_area) { - vfree(runtime->dma_area); - runtime->dma_area = NULL; - } + + vfree(runtime->dma_area); + runtime->dma_area = NULL; return 0; } @@ -1254,9 +1253,13 @@ static int vx_init_audio_io(struct vx_core *chip) /* allocate pipes */ chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL); + if (!chip->playback_pipes) + return -ENOMEM; chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL); - if (! chip->playback_pipes || ! chip->capture_pipes) + if (!chip->capture_pipes) { + kfree(chip->playback_pipes); return -ENOMEM; + } memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs); memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins); |