diff options
author | Peter Beutner <p.beutner@gmx.net> | 2005-07-07 20:57:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-07 21:23:53 -0400 |
commit | 6757ccc57d2cc4ab4e63d8aee97f2e6b9f998990 (patch) | |
tree | 472bad3348464fa74910d6ac8978b6a63cb01a35 /drivers/media | |
parent | 25a26ec3b60b29300a652d7d81a69b6bc08b35b5 (diff) |
[PATCH] dvb: core: fix race condition in FE_READ_STATUS ioctl
Fix a race condition where an application which issued a FE_READ_STATUS ioctl
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>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index f11daae91cd4..e561ac1e1b16 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -626,11 +626,21 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, | |||
626 | break; | 626 | break; |
627 | } | 627 | } |
628 | 628 | ||
629 | case FE_READ_STATUS: | 629 | case FE_READ_STATUS: { |
630 | fe_status_t* status = parg; | ||
631 | |||
632 | /* if retune was requested but hasn't occured yet, prevent | ||
633 | * that user get signal state from previous tuning */ | ||
634 | if(fepriv->state == FESTATE_RETUNE) { | ||
635 | err=0; | ||
636 | *status = 0; | ||
637 | break; | ||
638 | } | ||
639 | |||
630 | if (fe->ops->read_status) | 640 | if (fe->ops->read_status) |
631 | err = fe->ops->read_status(fe, (fe_status_t*) parg); | 641 | err = fe->ops->read_status(fe, status); |
632 | break; | 642 | break; |
633 | 643 | } | |
634 | case FE_READ_BER: | 644 | case FE_READ_BER: |
635 | if (fe->ops->read_ber) | 645 | if (fe->ops->read_ber) |
636 | err = fe->ops->read_ber(fe, (__u32*) parg); | 646 | err = fe->ops->read_ber(fe, (__u32*) parg); |