3.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Antti Palosaari <[email protected]>

commit f538e085138e519e25ae0828bd6c6e7492ce8ca4 upstream.

Maximum satellite symbol rate used is 45000000Sps which overflows
when multiplied by 135. As final calculation result is fraction,
we could use mult_frac macro in order to keep calculation inside
32 bit number limits and prevent overflow.

Original bug and fix was provided by Nibble Max. I decided to
implement it differently as it is now.

Reported-by: Nibble Max <[email protected]>
Tested-by: Nibble Max <[email protected]>
Signed-off-by: Antti Palosaari <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/media/tuners/m88ts2022.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/tuners/m88ts2022.c
+++ b/drivers/media/tuners/m88ts2022.c
@@ -314,7 +314,7 @@ static int m88ts2022_set_params(struct d
        div_min = gdiv28 * 78 / 100;
        div_max = clamp_val(div_max, 0U, 63U);
 
-       f_3db_hz = c->symbol_rate * 135UL / 200UL;
+       f_3db_hz = mult_frac(c->symbol_rate, 135, 200);
        f_3db_hz +=  2000000U + (frequency_offset_khz * 1000U);
        f_3db_hz = clamp(f_3db_hz, 7000000U, 40000000U);
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to