diff options
| author | Simon Glass <[email protected]> | 2014-07-23 06:55:15 -0600 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2014-07-23 14:07:26 +0100 |
| commit | c910e2e2da49036496a5b8b34425043675218d51 (patch) | |
| tree | 29d2a8d0ec37379167cd6e5659ef26ef6fa18b3e /drivers | |
| parent | f4cdead24a1a0c39c29c04e107c2f98ba61c5da8 (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 <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/core/uclass.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index a27f3d50275..61ca17e564a 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -23,6 +23,8 @@ struct uclass *uclass_find(enum uclass_id key) { struct uclass *uc; + if (!gd->dm_root) + return NULL; /* * TODO([email protected]): Optimise this, perhaps moving the found * node to the start of the list, or creating a linear array mapping |
