]> git.itanic.dy.fi Git - linux-stable/commit
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 18:21:13 +0000 (10:21 -0800)
commit53017a39386cce1b7b6da3013176364424793115
tree3b1405533bc098a0a0ef91e2971b73386fb517ab
parent7e1209105d7bc831bc7aed3e07f780e8e75c0ad3
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