]> git.ozlabs.org Git - petitboot/commitdiff
discover/boot: Safely cleanup after failed load
authorSam Mendoza-Jonas <sam@mendozajonas.com>
Tue, 15 Mar 2016 02:35:21 +0000 (13:35 +1100)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 22 Mar 2016 22:02:35 +0000 (09:02 +1100)
If a call to load_url_async() fails immediately, boot() will free the
boot task and return. If other jobs started by load_url_async()
are still running they will attempt to free their task struct in
load_url_process_exit(), however the original boot task is the parent
context of this process task, resulting in a double-free.

Instead call cleanup_cancellations if an error immediately occurs to
cancel any pending load operations safely before freeing the boot task.

Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>

No differences found