sound: pcm_oss, fix locking typo
PATCH 1/2 sound: pcm_oss, fix locking typo
s/mutex_lock/mutex_unlock/ on 2 fail paths in snd_pcm_oss_proc_write. Probably a typo, lock should be unlocked when leaving the function.
Signed-off-by Jiri Slaby <[email protected]>
Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
--- sound/core/oss/pcm_oss.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
sound/core/oss/pcm_oss.c +2 -2
@@ -2887,7 +2887,7 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry, setup =kmalloc (sizeof (*setup),GFP_KERNEL );if (! setup) { buffer->error = -ENOMEM ; -mutex_lock (&pstr->oss.setup_mutex); +mutex_unlock (&pstr->oss.setup_mutex);return ; }if (pstr->oss.setup_list ==NULL )
@@ -2901,7 +2901,7 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry,if (! template.task_name) {kfree (setup); buffer->error = -ENOMEM ; -mutex_lock (&pstr->oss.setup_mutex); +mutex_unlock (&pstr->oss.setup_mutex);return ; } }
Signature · 2 lines
1.6.2 caught by stanse
PATCH 2/2 sound: mixart, fix lock imbalance
There is an omitted unlock in one snd_mixart_hw_params fail path. Fix it.
Signed-off-by Jiri Slaby <[email protected]>
Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
--- sound/pci/mixart/mixart.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
sound/pci/mixart/mixart.c +1 -0
@@ -607,6 +607,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,/* set the format to the board */ err =mixart_set_format (stream, format);if (err <0 ) { +mutex_unlock (&mgr->setup_mutex);return err; }
Signature · 2 lines
1.6.2 caught by stanse
Takashi Iwai
AppliedAt Wed, 11 Mar 2009 20:11:40 +0100,
Quoted 5 lines · Jiri Slaby
s/mutex_lock/mutex_unlock/ on 2 fail paths in
snd_pcm_oss_proc_write. Probably a typo, lock should be unlocked when leaving the function.Signed-off-by Jiri Slaby <[email protected]>
Thanks, applied both patches now.
Takashi
Quoted 32 lines
Cc Jaroslav Kysela <[email protected]>Cc Takashi Iwai <[email protected]>--- sound/core/oss/pcm_oss.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)sound/core/oss/pcm_oss.c +2
-2@@ -2887,7 +2887,7 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry, setup =kmalloc (sizeof (*setup),GFP_KERNEL );if (! setup) { buffer->error = -ENOMEM ; -mutex_lock (&pstr->oss.setup_mutex); +mutex_unlock (&pstr->oss.setup_mutex);return ; }if (pstr->oss.setup_list ==NULL )@@ -2901,7 +2901,7 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry,if (! template.task_name) {kfree (setup); buffer->error = -ENOMEM ; -mutex_lock (&pstr->oss.setup_mutex); +mutex_unlock (&pstr->oss.setup_mutex);return ; } }Signature · 2 lines
1.6.2 caught by stanse