mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
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: 1da177e4c3
("Linux-2.6.12-rc2")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
committed by
CrazyCat
parent
df21b7152c
commit
a351a382c8
@@ -443,8 +443,8 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
fepriv->auto_step++;
|
fepriv->auto_step++;
|
||||||
fepriv->auto_sub_step = -1; /* it'll be incremented to 0 in a moment */
|
fepriv->auto_sub_step = 0;
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ready) fepriv->auto_sub_step++;
|
if (!ready) fepriv->auto_sub_step++;
|
||||||
|
Reference in New Issue
Block a user