hwmon: Prevent some divide by zeros in FAN_TO_REG()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 12 Dec 2013 07:05:33 +0000 (08:05 +0100)
committerJean Delvare <khali@endymion.delvare>
Thu, 12 Dec 2013 07:05:33 +0000 (08:05 +0100)
commit3806b45ba4655147a011df03242cc197ab986c43
tree6f16fdaab2125caf51cd1c9b2fb9cd9e1eb3674f
parent33a7ab91d509fa33b4bcd3ce0038cc80298050da
hwmon: Prevent some divide by zeros in FAN_TO_REG()

The "rpm * div" operations can overflow here, so this patch adds an
upper limit to rpm to prevent that.  Jean Delvare helped me with this
patch.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Roger Lucas <vt8231@hiddenengine.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/lm78.c
drivers/hwmon/sis5595.c
drivers/hwmon/vt8231.c