diff options
author | Simon Glass <sjg@chromium.org> | 2014-07-23 16:55:15 +0400 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-07-23 17:07:26 +0400 |
commit | c910e2e2da49036496a5b8b34425043675218d51 (patch) | |
tree | 29d2a8d0ec37379167cd6e5659ef26ef6fa18b3e /test/dm | |
parent | f4cdead24a1a0c39c29c04e107c2f98ba61c5da8 (diff) | |
download | u-boot-c910e2e2da49036496a5b8b34425043675218d51.tar.xz |
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/dm')
-rw-r--r-- | test/dm/core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/dm/core.c b/test/dm/core.c index 24e0b6b898..b0cfb42c85 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); |