The patch number 10521 was added via Douglas Schilling Landgraf 
<dougsl...@redhat.com>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

From: Douglas Schilling Landgraf  <dougsl...@redhat.com>
em28xx-audio: Add lock for users


Added lock for users count

Priority: high

Signed-off-by: Douglas Schilling Landgraf <dougsl...@redhat.com>


---

 linux/drivers/media/video/em28xx/em28xx-audio.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -r 3d6a5f68cefe -r cb89d94e541b 
linux/drivers/media/video/em28xx/em28xx-audio.c
--- a/linux/drivers/media/video/em28xx/em28xx-audio.c   Sun Feb 08 15:17:15 
2009 -0200
+++ b/linux/drivers/media/video/em28xx/em28xx-audio.c   Sun Feb 08 02:11:13 
2009 -0200
@@ -356,7 +356,9 @@ static int snd_em28xx_capture_open(struc
                dprintk("changing alternate number to 7\n");
        }
 
+       mutex_lock(&dev->lock);
        dev->adev.users++;
+       mutex_unlock(&dev->lock);
 
        snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
        dev->adev.capture_pcm_substream = substream;
@@ -375,12 +377,12 @@ static int snd_em28xx_pcm_close(struct s
 #endif
 {
        struct em28xx *dev = snd_pcm_substream_chip(substream);
-       dev->adev.users--;
 
        dprintk("closing device\n");
 
        dev->mute = 1;
        mutex_lock(&dev->lock);
+       dev->adev.users--;
        em28xx_audio_analog_set(dev);
        mutex_unlock(&dev->lock);
 


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/cb89d94e541b7635e9db8e3c39340e98cfbbecdd

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to