[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>
This commit is contained in:
committed by
Linus Torvalds
parent
25a26ec3b6
commit
6757ccc57d
@@ -626,11 +626,21 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case FE_READ_STATUS:
|
case FE_READ_STATUS: {
|
||||||
if (fe->ops->read_status)
|
fe_status_t* status = parg;
|
||||||
err = fe->ops->read_status(fe, (fe_status_t*) parg);
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
/* 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, status);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case FE_READ_BER:
|
case FE_READ_BER:
|
||||||
if (fe->ops->read_ber)
|
if (fe->ops->read_ber)
|
||||||
err = fe->ops->read_ber(fe, (__u32*) parg);
|
err = fe->ops->read_ber(fe, (__u32*) parg);
|
||||||
|
Reference in New Issue
Block a user