Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7aedfdd8 authored by Jack Pham's avatar Jack Pham
Browse files

usb: pd: Register power_supply notifier after completing init



There is a rare but possible chance that just after registering
the psy_changed notifier callback with the power_supply
framework that it could be called immediately, schedule the
usbpd_sm, and execute the worker on another thread, all before
usbpd_create() has completed. Since some structures, notably
pd->rx_lock, haven't been fully initialized yet, this leads
to spin_lock() call accessing uninitialized data. Fix this by
moving the power_supply_reg_notifier() call to the very end
of usbpd_create() after everything has been initialized.

Change-Id: I7d2bc9eca8e7e30dbc656be620a0f4fd8eea2239
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 3162449f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment