]> git.karo-electronics.de Git - mv-sheeva.git/commit
hwmon: (f71882fg) Fix various sysfs callback function issues
authorHans de Goede <hdegoede@redhat.com>
Wed, 7 Jan 2009 15:37:28 +0000 (16:37 +0100)
committerJean Delvare <khali@linux-fr.org>
Wed, 7 Jan 2009 15:37:28 +0000 (16:37 +0100)
commitce0bfa5ee25ddbe4072b16054e809f552bf72320
tree35418be8a28fcaf8cc65cf3d829d13f1f0ef4f3d
parent7567a0435520fe61420ff2cdc4cec1b5399a5134
hwmon: (f71882fg) Fix various sysfs callback function issues

While working on adding F8000 support I noticed that various of the
store sysfs functions (and a few of the show also) had issues.

This patch fixes the following issues in these functions:
* store: storing the result of strto[u]l in an int, resulting in a possible
  overflow before boundary checking
* store: use of f71882fg_update_device(), we don't want to read the whole
  device in store functions, just the registers we need
* store: use of cached register values instead of reading the needed regs
  in the store function, including cases where f71882fg_update_device() was
  not used, this could cause real isues
* show: shown value is a calculation of 2 or more cached register reads,
  without locking the data struct.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/f71882fg.c