mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] sound: pcm_oss, fix locking typo
@ 2009-03-11 19:11 Jiri Slaby
  2009-03-11 19:11 ` [PATCH 2/2] sound: mixart, fix lock imbalance Jiri Slaby
  2009-03-12  7:28 ` [PATCH 1/2] sound: pcm_oss, fix locking typo Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Slaby @ 2009-03-11 19:11 UTC (permalink / raw)
  To: tiwai; +Cc: linux-kernel, Jiri Slaby, Jaroslav Kysela

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 <jirislaby@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
---
 sound/core/oss/pcm_oss.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index ddf83c8..dda000b 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -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;
 			}
 		}
-- 
1.6.2
caught by stanse


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] sound: mixart, fix lock imbalance
  2009-03-11 19:11 [PATCH 1/2] sound: pcm_oss, fix locking typo Jiri Slaby
@ 2009-03-11 19:11 ` Jiri Slaby
  2009-03-12  7:28 ` [PATCH 1/2] sound: pcm_oss, fix locking typo Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2009-03-11 19:11 UTC (permalink / raw)
  To: tiwai; +Cc: linux-kernel, Jiri Slaby, Jaroslav Kysela

There is an omitted unlock in one snd_mixart_hw_params fail path. Fix it.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/mixart/mixart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index a593686..82bc5b9 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -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;
 	}
 
-- 
1.6.2
caught by stanse


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] sound: pcm_oss, fix locking typo
  2009-03-11 19:11 [PATCH 1/2] sound: pcm_oss, fix locking typo Jiri Slaby
  2009-03-11 19:11 ` [PATCH 2/2] sound: mixart, fix lock imbalance Jiri Slaby
@ 2009-03-12  7:28 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2009-03-12  7:28 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: linux-kernel, Jaroslav Kysela

At Wed, 11 Mar 2009 20:11:40 +0100,
Jiri Slaby wrote:
> 
> 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 <jirislaby@gmail.com>

Thanks, applied both patches now.


Takashi

> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.de>
> ---
>  sound/core/oss/pcm_oss.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
> index ddf83c8..dda000b 100644
> --- a/sound/core/oss/pcm_oss.c
> +++ b/sound/core/oss/pcm_oss.c
> @@ -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;
>  			}
>  		}
> -- 
> 1.6.2
> caught by stanse
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-12  7:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-11 19:11 [PATCH 1/2] sound: pcm_oss, fix locking typo Jiri Slaby
2009-03-11 19:11 ` [PATCH 2/2] sound: mixart, fix lock imbalance Jiri Slaby
2009-03-12  7:28 ` [PATCH 1/2] sound: pcm_oss, fix locking typo Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome