diff --git a/common/bootstage.c b/common/bootstage.c index 2c0110c263..4621105682 100644 --- a/common/bootstage.c +++ b/common/bootstage.c @@ -9,6 +9,8 @@ * permits accurate timestamping of each. */ +#define LOG_CATEGORY LOGC_BOOT + #include #include #include @@ -127,12 +129,16 @@ ulong bootstage_add_record(enum bootstage_id id, const char *name, /* Only record the first event for each */ rec = find_id(data, id); - if (!rec && data->rec_count < RECORD_COUNT) { - rec = &data->record[data->rec_count++]; - rec->time_us = mark; - rec->name = name; - rec->flags = flags; - rec->id = id; + if (!rec) { + if (data->rec_count < RECORD_COUNT) { + rec = &data->record[data->rec_count++]; + rec->time_us = mark; + rec->name = name; + rec->flags = flags; + rec->id = id; + } else { + log_warning("Bootstage space exhasuted\n"); + } } /* Tell the board about this progress */