]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
[media] dvb-core: fix 32-bit overflow during bandwidth calculation
authorAntti Palosaari <crope@iki.fi>
Tue, 14 Apr 2015 18:12:54 +0000 (15:12 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 20 May 2015 17:01:46 +0000 (14:01 -0300)
Frontend bandwidth calculation overflows on very high DVB-S/S2
symbol rates. Use mult_frac() macro in order to keep calculation
correct.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-core/dvb_frontend.c

index 882ca417f328a3b7f7c20f09e63992e642923981..a894d4c99ee8cb44e06e8501082908e954d87e88 100644 (file)
@@ -2216,7 +2216,7 @@ static int dtv_set_frontend(struct dvb_frontend *fe)
                break;
        }
        if (rolloff)
-               c->bandwidth_hz = (c->symbol_rate * rolloff) / 100;
+               c->bandwidth_hz = mult_frac(c->symbol_rate, rolloff, 100);
 
        /* force auto frequency inversion if requested */
        if (dvb_force_auto_inversion)