]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: axp20x_usb_power: Init work before enabling IRQs
authorSamuel Holland <samuel@sholland.org>
Sun, 24 Jan 2021 15:24:21 +0000 (09:24 -0600)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sun, 24 Jan 2021 23:25:26 +0000 (00:25 +0100)
commita1d5d414d5d642e9470c867e120038fd4cd72b61
treef5537ae285a22677e1ab8c466f6e7dd6b2160b29
parent8c18eb9ab474a2ffc2b091cac2a61c15ef6877a6
power: supply: axp20x_usb_power: Init work before enabling IRQs

The IRQ handler calls mod_delayed_work() on power->vbus_detect. However,
that work item is not initialized until after the IRQs are enabled. If
an IRQ is already pending when the driver is probed, the driver calls
mod_delayed_work() on an uninitialized work item, which causes an oops.

Fixes: 118a5a998d62 ("power: supply: axp20x_usb_power: Only poll while offline")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/axp20x_usb_power.c