]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
power: supply: ab8500: Avoid NULL pointers
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 22 May 2021 22:50:41 +0000 (00:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:22:42 +0000 (16:22 +0200)
commit4fc5a5f973b9bd7640cbdeaf9409e6035d64e8b0
tree42083dda70403ba6d32967b763691acf9f4ff784
parentb0c7c46e09f52cf36c55f70ca7b292b095de4f0b
power: supply: ab8500: Avoid NULL pointers

[ Upstream commit 5bcb5087c9dd3dca1ff0ebd8002c5313c9332b56 ]

Sometimes the code will crash because we haven't enabled
AC or USB charging and thus not created the corresponding
psy device. Fix it by checking that it is there before
notifying.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/power/ab8500_charger.c