diff options
author | Edward A. James <eajames@us.ibm.com> | 2017-10-27 18:55:05 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-10-30 02:35:54 +0100 |
commit | 6dcf2fb5e8db3704f50af1f198256cb4e2453f8b (patch) | |
tree | 2f7353f4a43eb7dce9c1e9ebdd62443b69408854 /drivers/hwmon/stts751.c | |
parent | Linux 4.14-rc7 (diff) | |
download | linux-6dcf2fb5e8db3704f50af1f198256cb4e2453f8b.tar.xz linux-6dcf2fb5e8db3704f50af1f198256cb4e2453f8b.zip |
hwmon: (pmbus/core) Prevent unintentional setting of page to 0xFF
The pmbus core may call read/write word data functions with a page value
of -1, intending to perform the operation without setting the page.
However, the read/write word data functions accept only unsigned 8-bit
page numbers, and therefore cannot check for negative page number to
avoid setting the page. This results in setting the page number to 0xFF.
This may result in errors or undefined behavior of some devices
(specifically the ir35221, which allows the page to be set to 0xFF,
but some subsequent operations to read registers may fail).
Switch the pmbus_set_page page parameter to an integer and perform the
check for negative page there. Make read/write functions consistent in
accepting an integer page number parameter.
Signed-off-by: Edward A. James <eajames@us.ibm.com>
Fixes: cbcdec6202c9 ("hwmon: (pmbus): Access word data for STATUS_WORD")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/stts751.c')
0 files changed, 0 insertions, 0 deletions