The work which is scheduled on a POR boot is potentially left
pending or running until after the device module is removed,
which could result in a use-after-free.
Fix by registering a cancel/sync callback, which gets executed as
part of standard resource unwinding.
This issue was detected with the help of Coccinelle.
Signed-off-by: Sven Van Asbroeck <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>