Skip to contentSkip to conversation

radio-mr800: add few lost mutex locks

PATCH In review Alexey Klimov 1 participant 1 message Feb 3, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 7/8 radio-mr800: add few lost mutex locks

Patch adds two lost mutex locks.

--

linux/drivers/media/radio/radio-mr800.c +5 -0
diff -r 5f3bbcc00bcf linux/drivers/media/radio/radio-mr800.c
@@ -434,7 +434,10 @@
 	if (radio->removed)
 		return -EIO;
 
+	mutex_lock(&radio->lock);
 	radio->curfreq = f->frequency;
+	mutex_unlock(&radio->lock);
+
 	retval = amradio_setfreq(radio, radio->curfreq);
 	if (retval < 0)
 		amradio_dev_warn(&radio->videodev->dev,
@@ -602,7 +605,9 @@
 	if (!radio)
 		return -ENODEV;
 
+	mutex_lock(&radio->lock);
 	radio->users = 0;
+	mutex_unlock(&radio->lock);
 
 	if (!radio->removed) {
 		retval = amradio_set_mute(radio, AMRADIO_STOP);
Signature · 1 line
Best regards, Klimov Alexey