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)
commit1bbb2809040a1f9c7c53c9f06c21aa83275ed27b
tree8891dc3129bf5cc7ee668c62526c6ff1de0866ba
parenta111daf0c53ae91e71fd2bfe7497862d14132e3e
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: 5b5513b88002 ("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