diff mbox

[1/4] DVB: dvb_frontend: fix stale parameters on initial frontend event

Message ID 1312471995-26292-1-git-send-email-obi@linuxtv.org (mailing list archive)
State Accepted
Headers show

Commit Message

Andreas Oberritter Aug. 4, 2011, 3:33 p.m. UTC
- FE_SET_FRONTEND triggers a frontend event, which uses stale data.
  Modify it to use the data given by the user.

- Fixes a regression caused by a5959dbea37973a2440eeba39fba32c79d862ec2.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index efe9c30..23d79d0 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1827,6 +1827,13 @@  static int dvb_frontend_ioctl_legacy(struct file *file,
 			dtv_property_cache_sync(fe, c, &fepriv->parameters_in);
 		}
 
+		/*
+		 * Initialize output parameters to match the values given by
+		 * the user. FE_SET_FRONTEND triggers an initial frontend event
+		 * with status = 0, which copies output parameters to userspace.
+		 */
+		fepriv->parameters_out = fepriv->parameters_in;
+
 		memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings));
 		memcpy(&fetunesettings.parameters, parg,
 		       sizeof (struct dvb_frontend_parameters));