From: Daniel Scheller Date: Sun, 20 Aug 2017 10:29:14 +0000 (-0400) Subject: media: dvb-frontends/stv0910: fix FE_HAS_LOCK check order in tune() X-Git-Tag: v4.14-rc1~113^2~324 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=f0e72c29fd063aca325afee25a6f9bcc22871837;p=linux.git media: dvb-frontends/stv0910: fix FE_HAS_LOCK check order in tune() It should first read the status and then check if FE has lock. Signed-off-by: Daniel Scheller Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb-frontends/stv0910.c b/drivers/media/dvb-frontends/stv0910.c index 45d94c3a29f2..e87a3ee6155c 100644 --- a/drivers/media/dvb-frontends/stv0910.c +++ b/drivers/media/dvb-frontends/stv0910.c @@ -1581,13 +1581,15 @@ static int tune(struct dvb_frontend *fe, bool re_tune, return r; state->tune_time = jiffies; } - if (*status & FE_HAS_LOCK) - return 0; - *delay = HZ; r = read_status(fe, status); if (r) return r; + + if (*status & FE_HAS_LOCK) + return 0; + *delay = HZ; + return 0; }