summaryrefslogtreecommitdiffstats
path: root/discover/device-handler.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-01-23 14:53:32 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-01-31 13:18:38 +1100
commitd94bb8c48f42678a5f1cf0041429b82aa1938540 (patch)
tree37e8fad4895c077a282e62a88a05729299724e4b /discover/device-handler.c
parent75e89298319041ac2cc96102c8345dc175e5e0db (diff)
downloadtalos-petitboot-d94bb8c48f42678a5f1cf0041429b82aa1938540.tar.gz
talos-petitboot-d94bb8c48f42678a5f1cf0041429b82aa1938540.zip
process: Cancel all asynchronous jobs on reinitv1.4.1
If an asynchronous job is running over a reinit, the process can return and run its callback function after the reinit. This becomes a problem if the callback function accesses pointers that were only valid before the reinit (eg. device structs). If a reinit is requested explicitly stop all active asynchronous jobs and clear their callback functions before the reinit. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/device-handler.c')
-rw-r--r--discover/device-handler.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index 78fb159..3cf7edf 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -358,6 +358,9 @@ void device_handler_reinit(struct device_handler *handler)
handler->pending_boot_is_default = false;
}
+ /* Cancel any remaining async jobs */
+ process_stop_async_all();
+
/* free unresolved boot options */
list_for_each_entry_safe(&handler->unresolved_boot_options,
opt, tmp, list)
OpenPOWER on IntegriCloud