]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (occ) Prevent power cap command overwriting poll response
authorEddie James <eajames@linux.ibm.com>
Tue, 28 Jun 2022 20:30:29 +0000 (15:30 -0500)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 29 Jun 2022 20:59:23 +0000 (13:59 -0700)
commite5b9cd8632acb7f110e075fc8b84d3d8daf76ea4
tree8891dc3129bf5cc7ee668c62526c6ff1de0866ba
parent08aafa0d475a08e31a13403e9df41c7179f4bdcd
hwmon: (occ) Prevent power cap command overwriting poll response

Currently, the response to the power cap command overwrites the
first eight bytes of the poll response, since the commands use
the same buffer. This means that user's get the wrong data between
the time of sending the power cap and the next poll response update.
Fix this by specifying a different buffer for the power cap command
response.

Fixes: a20019ce92b0 ("hwmon: Add On-Chip Controller (OCC) hwmon driver")
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/20220628203029.51747-1-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/occ/common.c
drivers/hwmon/occ/common.h
drivers/hwmon/occ/p8_i2c.c
drivers/hwmon/occ/p9_sbe.c