diff options
author | Eddie James <eajames@linux.ibm.com> | 2021-02-09 18:12:34 +0100 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2021-06-04 06:59:58 +0200 |
commit | 75028ef4583091c355ac78ef03b64fc8f1f87909 (patch) | |
tree | 72174900075024599cd88a76db7c2bb80c4f14da /drivers/hwmon/occ | |
parent | fsi: occ: Log error for checksum failure (diff) | |
download | linux-75028ef4583091c355ac78ef03b64fc8f1f87909.tar.xz linux-75028ef4583091c355ac78ef03b64fc8f1f87909.zip |
hwmon: (occ) Start sequence number at one
Initialize the sequence number at one, rather than zero, in order
to prevent false matches with the zero-initialized OCC SRAM
buffer before the OCC is fully initialized.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210209171235.20624-4-eajames@linux.ibm.com
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/hwmon/occ')
-rw-r--r-- | drivers/hwmon/occ/common.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c index f1ac153d0b56..7e73418ee0ad 100644 --- a/drivers/hwmon/occ/common.c +++ b/drivers/hwmon/occ/common.c @@ -1151,6 +1151,8 @@ int occ_setup(struct occ *occ, const char *name) { int rc; + /* start with 1 to avoid false match with zero-initialized SRAM buffer */ + occ->seq_no = 1; mutex_init(&occ->lock); occ->groups[0] = &occ->group; |