]> 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)
commit1b211fde42c835daa0d18d497db99af6a99428f5
tree8891dc3129bf5cc7ee668c62526c6ff1de0866ba
parent4764e99deee460568d59e6c88fcf402440c6a616
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: e733c859c13a ("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