projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
arm64: zynqmp: Enables SPI_FLASH_BAR
[oweals/u-boot.git]
/
common
/
bootstage.c
diff --git
a/common/bootstage.c
b/common/bootstage.c
index b866e66979e3d8577febda37141e8c5db8b1c22a..56ef91ad85995dde2addef0be43694e4ed3813f6 100644
(file)
--- a/
common/bootstage.c
+++ b/
common/bootstage.c
@@
-1,7
+1,6
@@
+// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2011, Google Inc. All rights reserved.
/*
* Copyright (c) 2011, Google Inc. All rights reserved.
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
*/
@@
-11,7
+10,7
@@
*/
#include <common.h>
*/
#include <common.h>
-#include <libfdt.h>
+#include <li
nux/li
bfdt.h>
#include <malloc.h>
#include <linux/compiler.h>
#include <malloc.h>
#include <linux/compiler.h>
@@
-100,6
+99,13
@@
ulong bootstage_add_record(enum bootstage_id id, const char *name,
struct bootstage_data *data = gd->bootstage;
struct bootstage_record *rec;
struct bootstage_data *data = gd->bootstage;
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)
id = data->next_id++;
if (flags & BOOTSTAGEF_ALLOC)
id = data->next_id++;