power: supply: twl4030_charger: fix charging current out-of-bounds
authorAndreas Kemnade <andreas@kemnade.info>
Mon, 17 Sep 2018 05:20:35 +0000 (07:20 +0200)
committerSebastian Reichel <sre@kernel.org>
Thu, 20 Sep 2018 00:15:41 +0000 (02:15 +0200)
commit8314c212f995bc0d06b54ad02ef0ab4089781540
tree5f3db3db4f652fd179cf26beeb86eb7ec68bff5c
parentad1570d99f280f73c72510d7f79db9adf599474b
power: supply: twl4030_charger: fix charging current out-of-bounds

the charging current uses unsigned int variables, if we step back
if the current is still low, we would run into negative which
means setting the target to a huge value.
Better add checks here.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/twl4030_charger.c