mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
bootstage: Allow calling bootstage_mark() before bootstage_init()
It is possible for this to happen if something goes wrong very early in the init sequence. Add a check for this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
a1396cdc4b
commit
173577252f
1 changed files with 7 additions and 0 deletions
|
@ -99,6 +99,13 @@ ulong bootstage_add_record(enum bootstage_id id, const char *name,
|
||||||
struct bootstage_data *data = gd->bootstage;
|
struct bootstage_data *data = gd->bootstage;
|
||||||
struct bootstage_record *rec;
|
struct bootstage_record *rec;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* initf_bootstage() is called very early during boot but since hang()
|
||||||
|
* calls bootstage_error() we can be called before bootstage is set up.
|
||||||
|
* Add a check to avoid this.
|
||||||
|
*/
|
||||||
|
if (!data)
|
||||||
|
return mark;
|
||||||
if (flags & BOOTSTAGEF_ALLOC)
|
if (flags & BOOTSTAGEF_ALLOC)
|
||||||
id = data->next_id++;
|
id = data->next_id++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue