summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2005-06-06 17:51:27 +0000
committerJohannes Stezenbach <devnull@localhost>2005-06-06 17:51:27 +0000
commit09cd5f28c1bcb6cfae3af6b83c0cb56b6773306e (patch)
tree0fc8ac3416655cd18bb3282ee1c72b4679bef516 /linux/drivers/media
parent7061af7fe82c590489c23ee40e3919740de72233 (diff)
downloadmediapointer-dvb-s2-09cd5f28c1bcb6cfae3af6b83c0cb56b6773306e.tar.gz
mediapointer-dvb-s2-09cd5f28c1bcb6cfae3af6b83c0cb56b6773306e.tar.bz2
Fix a race condition where an application which issued FE_READ_STATUS
directly after FE_SET_FRONTEND would see an old status, i.e. FE_READ_STATUS would be executed before the frontend thread has even seen the tungin request from FE_SET_FRONTEND. Signed-off-by: Peter Beutner <p.beutner@gmx.net>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_frontend.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index d6b7a9de4..1439346a5 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -627,11 +627,21 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
break;
}
- case FE_READ_STATUS:
+ case FE_READ_STATUS: {
+ fe_status_t* status = parg;
+
+ /* if retune was requested but hasn't occured yet, prevent
+ * that user get signal state from previous tuning */
+ if(fepriv->state == FESTATE_RETUNE) {
+ err=0;
+ *status = 0;
+ break;
+ }
+
if (fe->ops->read_status)
- err = fe->ops->read_status(fe, (fe_status_t*) parg);
+ err = fe->ops->read_status(fe, status);
break;
-
+ }
case FE_READ_BER:
if (fe->ops->read_ber)
err = fe->ops->read_ber(fe, (__u32*) parg);