diff options
author | Sven Van Asbroeck <thesven73@gmail.com> | 2019-02-15 16:43:02 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-15 11:54:57 +0200 |
commit | 49a7ee280cc69b596ea948eb552f60ceab5df15d (patch) | |
tree | 7c9d5b4003af30520bbdf37ebc392959c41812d2 /.cocciconfig | |
parent | 912d34161326c7461250d36917663417bf8601dc (diff) |
power: supply: max14656: fix potential use-before-alloc
[ Upstream commit 0cd0e49711556d2331a06b1117b68dd786cb54d2 ]
Call order on probe():
- max14656_hw_init() enables interrupts on the chip
- devm_request_irq() starts processing interrupts, isr
could be called immediately
- isr: schedules delayed work (irq_work)
- irq_work: calls power_supply_changed()
- devm_power_supply_register() registers the power supply
Depending on timing, it's possible that power_supply_changed()
is called on an unregistered power supply structure.
Fix by registering the power supply before requesting the irq.
Cc: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to '.cocciconfig')
0 files changed, 0 insertions, 0 deletions