]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: dvb_frontend: don't play tricks with underflow values
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 15 Oct 2024 14:05:16 +0000 (16:05 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 18 Oct 2024 08:43:03 +0000 (10:43 +0200)
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>
drivers/media/dvb-core/dvb_frontend.c

index 4f78f30b3646e4715a2a6e92a29f9fdf321bf8f4..a05aa271a1baa7a87acc86fd45de814b779c3bb9 100644 (file)
@@ -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++;