Skip to content
Commit b55d073e authored by Su Hui's avatar Su Hui Committed by Sebastian Reichel
Browse files

power: supply: bq256xx: fix some problem in bq256xx_hw_init

smatch complains that there is a buffer overflow and clang complains
'ret' is never read.

Smatch error:
drivers/power/supply/bq256xx_charger.c:1578 bq256xx_hw_init() error:
buffer overflow 'bq256xx_watchdog_time' 4 <= 4

Clang static checker:
Value stored to 'ret' is never read.

Add check for buffer overflow and error code from regmap_update_bits().

Fixes: 32e4978b

 ("power: supply: bq256xx: Introduce the BQ256XX charger driver")
Signed-off-by: default avatarSu Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20231116041822.1378758-1-suhui@nfschina.com
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 054eb237
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment