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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 8 Dec 2009 19:17:10 +0000 (11:17 -0800)
commitbf5d113f0353b600bff5320f0b7b9c304c57f5d7
tree469f755d21ae820de698327a2b2090e7f5245825
parent6e7e66fbee87251c07c59c04e7f1ed3ff4f3b151
V4L/DVB (13107): tda18271: fix overflow in FM radio frequency calculation

commit 4d8317876d5f53ef792e90f89d8f162d7bca5c81 upstream.

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/media/common/tuners/tda18271-fe.c