V4L/DVB (13107): tda18271: fix overflow in FM radio frequency calculation
authorMichael Krufky <mkrufky@kernellabs.com>
Sun, 27 Sep 2009 17:05:12 +0000 (14:05 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 7 Nov 2009 14:55:04 +0000 (12:55 -0200)
commit4d8317876d5f53ef792e90f89d8f162d7bca5c81
tree05da791adc6b44f828876a2bac6de97a397d9528
parent7646b9de26c54cf4bc9c446d7ada9f91ece31e0a
V4L/DVB (13107): tda18271: fix overflow in FM radio frequency calculation

Multiplication by 62500 causes an overflow in the 32 bit freq variable,
which is later divided by 1000 when using FM radio.

This patch prevents the overflow by scaling the frequency value correctly
upfront.  Thanks to Henk Vergonet for spotting the problem and providing
a preliminary patch, which this changeset was based upon.

Cc: Henk Vergonet <Henk.Vergonet@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
CC: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/tda18271-fe.c