summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-07-23 06:55:15 -0600
committerSimon Glass <sjg@chromium.org>2014-07-23 14:07:26 +0100
commitc910e2e2da49036496a5b8b34425043675218d51 (patch)
tree29d2a8d0ec37379167cd6e5659ef26ef6fa18b3e /test
parentf4cdead24a1a0c39c29c04e107c2f98ba61c5da8 (diff)
dm: Avoid accessing uclasses before they are ready
Don't allow access to uclasses before they have been initialised. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/dm/core.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/dm/core.c b/test/dm/core.c
index 24e0b6b898d..b0cfb42c85f 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -570,3 +570,17 @@ static int dm_test_pre_reloc(struct dm_test_state *dms)
return 0;
}
DM_TEST(dm_test_pre_reloc, 0);
+
+static int dm_test_uclass_before_ready(struct dm_test_state *dms)
+{
+ struct uclass *uc;
+
+ ut_assertok(uclass_get(UCLASS_TEST, &uc));
+
+ memset(gd, '\0', sizeof(*gd));
+ ut_asserteq_ptr(NULL, uclass_find(UCLASS_TEST));
+
+ return 0;
+}
+
+DM_TEST(dm_test_uclass_before_ready, 0);