Commit 2d8cb9ff authored by Nikita Zhandarovich's avatar Nikita Zhandarovich Committed by Lee Jones
Browse files

mfd: sm501: Switch to BIT() to mitigate integer overflows



If offset end up being high enough, right hand expression in functions
like sm501_gpio_set() shifted left for that number of bits, may
not fit in int type.

Just in case, fix that by using BIT() both as an option safe from
overflow issues and to make this step look similar to other gpio
drivers.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: f61be273 ("sm501: add gpiolib support")
Signed-off-by: default avatarNikita Zhandarovich <n.zhandarovich@fintech.ru>
Link: https://lore.kernel.org/r/20250115171206.20308-1-n.zhandarovich@fintech.ru


Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent 9675c059
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment