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 <da...@identd.dyndns.org> for pointing to
this weak place in driver.

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

--
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;
 }


-- 
Best regards, Klimov Alexey

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to