media: stb0899_algo: initialize cfr before using it
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 15 Oct 2024 11:29:43 +0000 (13:29 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 18 Oct 2024 08:43:03 +0000 (10:43 +0200)
The loop at stb0899_search_carrier() starts with a random
value for cfr, as reported by Coverity.

Initialize it to zero, just like stb0899_dvbs_algo() to ensure
that carrier search won't bail out.

Fixes: 8bd135bab91f ("V4L/DVB (9375): Add STB0899 support")
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/dvb-frontends/stb0899_algo.c

index df89c33dac23c58301a60569a29fd322e564aef5..40537c4ccb0d75ba11248bae7894b1bd908e4ca5 100644 (file)
@@ -269,7 +269,7 @@ static enum stb0899_status stb0899_search_carrier(struct stb0899_state *state)
 
        short int derot_freq = 0, last_derot_freq = 0, derot_limit, next_loop = 3;
        int index = 0;
-       u8 cfr[2];
+       u8 cfr[2] = {0};
        u8 reg;
 
        internal->status = NOCARRIER;