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

Commit 74f0aaba authored by Sven Van Asbroeck's avatar Sven Van Asbroeck Committed by Sebastian Reichel
Browse files

power: supply: ds2782: fix possible use-after-free on remove



In remove(), use cancel_delayed_work_sync() to cancel the
delayed work. Otherwise there's a chance that this work
will continue to run until after the device has been removed.

While we're here, fix the deallocation order in remove(),
to correspond to the inverse of the probe() allocation
order. This guarantees that any remaining work can run
to completion with all driver structures still intact.

This issue was detected with the help of Coccinelle.

Signed-off-by: default avatarSven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent f83a6ece
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