diff mbox

radio-mr800: fix radio->muted and radio->stereo

Message ID 1232773624.6320.17.camel@tux.localhost (mailing list archive)
State Accepted
Headers show

Commit Message

Alexey Klimov Jan. 24, 2009, 5:07 a.m. UTC
Hello, Mauro

This is simple fix for mr800 usb radio driver.
It would be great to have it in next upstream pull request if you don't
mind.

---
Move radio->muted and radio->stereo in section where radio mutex is
locked to avoid possible race condition problems or access to memory.
Thanks to David Ellingsworth <david@identd.dyndns.org> for pointing to
this weak place in driver.

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>

--
diff mbox

Patch

diff -r 6a6eb9efc6cd linux/drivers/media/radio/radio-mr800.c
--- a/linux/drivers/media/radio/radio-mr800.c	Fri Jan 23 22:35:12 2009 -0200
+++ b/linux/drivers/media/radio/radio-mr800.c	Sat Jan 24 07:22:38 2009 +0300
@@ -197,9 +197,9 @@ 
 		return retval;
 	}
 
+	radio->muted = 0;
+
 	mutex_unlock(&radio->lock);
-
-	radio->muted = 0;
 
 	return retval;
 }
@@ -233,9 +233,9 @@ 
 		return retval;
 	}
 
+	radio->muted = 1;
+
 	mutex_unlock(&radio->lock);
-
-	radio->muted = 1;
 
 	return retval;
 }
@@ -287,9 +287,9 @@ 
 		return retval;
 	}
 
+	radio->stereo = 0;
+
 	mutex_unlock(&radio->lock);
-
-	radio->stereo = 0;
 
 	return retval;
 }