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

Commit b11674cf authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy Committed by Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: fix a potential race condition in accessing dc_psy



Commit abc711031653f5af30de63fdf41e878d9b4a09c1 ("power:
qpnp-smbcharger: Fix uninitialized access to dc_psy") tried
fixing an uninitialized access to dc_psy. However, there is
a race condition where dc_psy_type can get set just after
reading from device tree node but the dc_psy itself was not
registered at all.

This ends up in a system crash when the driver tries to call
power_supply_changed of dc_psy when it's not even registered.
Fix this by checking whether the dc_psy is registered before
calling power_supply_changed.

CRs-Fixed: 852821
Change-Id: Ic5f032107e0f5f1190b335e9d5de3e5497fd1e3c
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 210b17b0
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