boot: Keep track of which bootmeths have been used
Add a bitfield which tracks when bootmeths have been used. This will be needed when global bootmeths can be used later in the iteration. Fix a missing bootflow_free() while here. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -199,6 +199,16 @@ int bootmeth_setup_iter_order(struct bootflow_iter *iter, bool include_global)
|
||||
iter->doing_global = true;
|
||||
iter->have_global = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* check we don't exceed the maximum bits in methods_done when tracking
|
||||
* which global bootmeths have run
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_BOOTMETH_GLOBAL) && count > BOOTMETH_MAX_COUNT) {
|
||||
free(order);
|
||||
return log_msg_ret("tmb", -ENOSPC);
|
||||
}
|
||||
|
||||
iter->method_order = order;
|
||||
iter->num_methods = count;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user