Skip to content
Commit f9be5cb6 authored by Ondrej Jirman's avatar Ondrej Jirman Committed by Sebastian Reichel
Browse files

power: supply: ip5xxx: Fix integer overflow in current_now calculation



When current is larger than ~2A, the multiplication in current_now
property overflows and the kernel reports invalid negative current
value. Change the numerator and denominator while preserving their
ratio to allow up to +-6A before the overflow.

Fixes: 75853406 ("power: supply: Add a driver for Injoinic power bank ICs")
Signed-off-by: default avatarOndrej Jirman <megi@xff.cz>
Reviewed-by: default avatarSamuel Holland <samuel@sholland.org>
[use 149197/200 instead of 261095/350 as suggested by Samuel]
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 883babd4
Loading
Loading
Loading
Loading
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