summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Pasternak <vadimp@nvidia.com>2021-09-27 17:22:14 +0300
committerHans de Goede <hdegoede@redhat.com>2021-10-11 14:57:22 +0200
commitdb9cc7d6f95e7d89b0ce57e785cfd9d67a7505d8 (patch)
treea79459b724b4921100021b41858c841618c007be
parent9b024201693e397441668cca0d2df7055fe572eb (diff)
downloadlinux-db9cc7d6f95e7d89b0ce57e785cfd9d67a7505d8.tar.gz
linux-db9cc7d6f95e7d89b0ce57e785cfd9d67a7505d8.tar.bz2
linux-db9cc7d6f95e7d89b0ce57e785cfd9d67a7505d8.zip
platform/mellanox: mlxreg-io: Fix read access of n-bytes size attributes
Fix shift argument for function rol32(). It should be provided in bits, while was provided in bytes. Fixes: 86148190a7db ("platform/mellanox: mlxreg-io: Add support for complex attributes") Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20210927142214.2613929-3-vadimp@nvidia.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--drivers/platform/mellanox/mlxreg-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/mellanox/mlxreg-io.c b/drivers/platform/mellanox/mlxreg-io.c
index a023ec02126b..a916cd89cbbe 100644
--- a/drivers/platform/mellanox/mlxreg-io.c
+++ b/drivers/platform/mellanox/mlxreg-io.c
@@ -98,7 +98,7 @@ mlxreg_io_get_reg(void *regmap, struct mlxreg_core_data *data, u32 in_val,
if (ret)
goto access_error;
- *regval |= rol32(val, regsize * i);
+ *regval |= rol32(val, regsize * i * 8);
}
}