[PATCH] radio-mr800: fix radio->muted and radio->stereo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx> for pointing to
this weak place in driver.

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

--
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux