V4L/DVB (9380): FIX: a possible division by zero
authorManu Abraham <abraham.manu@gmail.com>
Sat, 24 Feb 2007 12:14:39 +0000 (09:14 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 29 Dec 2008 19:53:14 +0000 (17:53 -0200)
Thanks to Marko Schluessler <marco@lordzodiac.de>

Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/stb0899_algo.c

index 0ae9649758146203aebcde5795df2ae3eefdc888..876931527c71b3adc53bd805913df7bd63ad94cd 100644 (file)
@@ -933,9 +933,9 @@ static void stb0899_dvbs2_set_btr_loopbw(struct stb0899_state *state)
        sym_peak *= 576000;
        K = (1 << config->btr_nco_bits) / (internal->master_clk / 1000);
        K *= (internal->srate / 1000000) * decim; /*k=k 10^-8*/
-       K = sym_peak / K;
 
        if (K != 0) {
+               K = sym_peak / K;
                wn = (4 * zeta * zeta) + 1000000;
                wn = (2 * (loopbw_percent * 1000) * 40 * zeta) /wn;  /*wn =wn 10^-8*/