dm: core: Check for empty list in uclass_find_device()
authorSimon Glass <sjg@chromium.org>
Fri, 31 Jul 2015 15:31:19 +0000 (09:31 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 5 Aug 2015 14:42:40 +0000 (08:42 -0600)
commit2fda14ae6aa36798b59ab0591a2009ead206159b
treed179bd7e426095ec4377cc10ed682aca8fec8c9d
parent3834f41720b9340c97d8970d5a712fdcf2031df3
dm: core: Check for empty list in uclass_find_device()

This function needs to check the list has entries before traversing it.
Fix this bug.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/core/uclass.c