Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -2
+2 -2
drivers/media/dvb-core/dvb_frontend.c
··· 443 443 444 444 default: 445 445 fepriv->auto_step++; 446 - fepriv->auto_sub_step = -1; /* it'll be incremented to 0 in a moment */ 447 - break; 446 + fepriv->auto_sub_step = 0; 447 + continue; 448 448 } 449 449 450 450 if (!ready) fepriv->auto_sub_step++;