summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2024-10-15 17:05:16 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2024-10-18 11:43:03 +0300
commit9883a4d41aba7612644e9bb807b971247cea9b9d (patch)
tree9ab5beacc9343aae241ddb37a1c430ac3a6e19b7
parent972e63e895abbe8aa1ccbdbb4e6362abda7cd457 (diff)
downloadlinux-9883a4d41aba7612644e9bb807b971247cea9b9d.tar.xz
media: dvb_frontend: don't play tricks with underflow values
fepriv->auto_sub_step is unsigned. Setting it to -1 is just a trick to avoid calling continue, as reported by Coverity. It relies to have this code just afterwards: if (!ready) fepriv->auto_sub_step++; Simplify the code by simply setting it to zero and use continue to return to the while loop. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/media/dvb-core/dvb_frontend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 4f78f30b3646..a05aa271a1ba 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -443,8 +443,8 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
default:
fepriv->auto_step++;
- fepriv->auto_sub_step = -1; /* it'll be incremented to 0 in a moment */
- break;
+ fepriv->auto_sub_step = 0;
+ continue;
}
if (!ready) fepriv->auto_sub_step++;