diff options
| author | Ondrej Jirman <[email protected]> | 2022-10-28 22:40:52 +0000 |
|---|---|---|
| committer | Sebastian Reichel <[email protected]> | 2022-10-31 23:02:36 +0000 |
| commit | f9be5cb6c1f0191f8bcf4413b7e17e58e8dfaaa1 (patch) | |
| tree | 29deaa1db07ea6a611273463b9040f979b5da204 /net/bluetooth/hci_request.c | |
| parent | power: supply: rk817: Change rk817_chg_cur_to_reg to int (diff) | |
| download | kernel-f9be5cb6c1f0191f8bcf4413b7e17e58e8dfaaa1.tar.gz kernel-f9be5cb6c1f0191f8bcf4413b7e17e58e8dfaaa1.zip | |
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: 75853406fa27 ("power: supply: Add a driver for Injoinic power bank ICs")
Signed-off-by: Ondrej Jirman <[email protected]>
Reviewed-by: Samuel Holland <[email protected]>
[use 149197/200 instead of 261095/350 as suggested by Samuel]
Signed-off-by: Sebastian Reichel <[email protected]>
Diffstat (limited to 'net/bluetooth/hci_request.c')
0 files changed, 0 insertions, 0 deletions
