Skip to content
Snippets Groups Projects
Commit d9428f08 authored by Vadim Pasternak's avatar Vadim Pasternak Committed by Greg Kroah-Hartman
Browse files

platform/mellanox: mlxreg-io: Fix read access of n-bytes size attributes


commit db9cc7d6 upstream.

Fix shift argument for function rol32(). It should be provided in bits,
while was provided in bytes.

Fixes: 86148190 ("platform/mellanox: mlxreg-io: Add support for complex attributes")
Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20210927142214.2613929-3-vadimp@nvidia.com


Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c216cebd
No related branches found
No related tags found
No related merge requests found
...@@ -98,7 +98,7 @@ mlxreg_io_get_reg(void *regmap, struct mlxreg_core_data *data, u32 in_val, ...@@ -98,7 +98,7 @@ mlxreg_io_get_reg(void *regmap, struct mlxreg_core_data *data, u32 in_val,
if (ret) if (ret)
goto access_error; goto access_error;
*regval |= rol32(val, regsize * i); *regval |= rol32(val, regsize * i * 8);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment