log: fixup log_head after relocating global data
When `gd` is relocated during `spl_relocate_stack_gd()` the
doubly-linked circular list in the `log_head` member is broken.
The last element of the list should point back to the initial
`list_head`, but as the initial `list_head` is moved the pointer becomes
stale. As a result the loop in `log_dispatch` would never finish.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
diff --git a/common/log.c b/common/log.c
index b2de57f..42d35f0 100644
--- a/common/log.c
+++ b/common/log.c
@@ -428,6 +428,11 @@
return 0;
}
+void log_fixup_for_gd_move(struct global_data *new_gd)
+{
+ new_gd->log_head.prev->next = &new_gd->log_head;
+}
+
int log_init(void)
{
struct log_driver *drv = ll_entry_start(struct log_driver, log_driver);