mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
dm: test: Don't clear global_data in dm_test_uclass_before_ready()
We must not clear global_data even in tests, since the ram_buffer (which is used by malloc()) will also be lost, and subsequent tests will fail. Zero only the global_data fields that are required for the test to function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com> Tested-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
98a1605309
commit
f9fd4558ea
1 changed files with 4 additions and 1 deletions
|
@ -651,7 +651,10 @@ static int dm_test_uclass_before_ready(struct dm_test_state *dms)
|
|||
|
||||
ut_assertok(uclass_get(UCLASS_TEST, &uc));
|
||||
|
||||
memset(gd, '\0', sizeof(*gd));
|
||||
gd->dm_root = NULL;
|
||||
gd->dm_root_f = NULL;
|
||||
memset(&gd->uclass_root, '\0', sizeof(gd->uclass_root));
|
||||
|
||||
ut_asserteq_ptr(NULL, uclass_find(UCLASS_TEST));
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue