Skip to content

Commit

Permalink
discover/device-handler: Cancel pending boot on reinit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sammj committed Jan 31, 2017
1 parent 6fab22d commit 75e8929
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions discover/device-handler.c
Expand Up @@ -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,
Expand Down

0 comments on commit 75e8929

Please sign in to comment.