summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-01-23 14:53:08 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-01-31 13:18:25 +1100
commit75e89298319041ac2cc96102c8345dc175e5e0db (patch)
tree1d42d3bd4f32e0a79ba76f98da2ebb3837064ab8
parent6fab22db693aaf495b8be0699e6d177ba69d79ed (diff)
downloadpetitboot-75e89298319041ac2cc96102c8345dc175e5e0db.zip
petitboot-75e89298319041ac2cc96102c8345dc175e5e0db.tar.gz
discover/device-handler: Cancel pending boot on reinit
When a reinit is requested device_handler_cancel_default() is called, however as the name suggests this only cancels the boot task if it is the result of a default boot option. We also want to cancel a boot task if it was executed manually because it may have outstanding asynchronous transfers running, so explicitly cancel it during reinit. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r--discover/device-handler.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index a3891c4..78fb159 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -351,6 +351,12 @@ void device_handler_reinit(struct device_handler *handler)
unsigned int i;
device_handler_cancel_default(handler);
+ /* Cancel any pending non-default boot */
+ if (handler->pending_boot) {
+ boot_cancel(handler->pending_boot);
+ handler->pending_boot = NULL;
+ handler->pending_boot_is_default = false;
+ }
/* free unresolved boot options */
list_for_each_entry_safe(&handler->unresolved_boot_options,
OpenPOWER on IntegriCloud