Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c00a6861 authored by Maxime Coquelin's avatar Maxime Coquelin Committed by Sasha Levin
Browse files

regmap: Fix possible shift overflow in regmap_field_init()



[ Upstream commit 921cc29473a0d7c109105c1876ddb432f4a4be7d ]

The way the mask is generated in regmap_field_init() is wrong.
Indeed, a field initialized with msb = 31 and lsb = 0 provokes a shift
overflow while calculating the mask field.

On some 32 bits architectures, such as x86, the generated mask is 0,
instead of the expected 0xffffffff.

This patch uses GENMASK() to fix the problem, as this macro is already safe
regarding shift overflow.

Signed-off-by: default avatarMaxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent f099f4aa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment