diff options
author | Sean Anderson <seanga2@gmail.com> | 2020-04-06 10:23:09 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-04-09 09:18:56 -0400 |
commit | 97c7ac214e1df5579a1f9f35d36c717e6975619a (patch) | |
tree | 8df9f976ce65a3257a7866b0d65fa4c19efa25fb /drivers/core/dump.c | |
parent | dfd5321becc54d7ce9fd564aaaba70a2132c058e (diff) |
cmd: Add test and fix bugs for dm drivers
Add a test for the dm drivers command. Also fix a null pointer dereference
revealed by said test.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/dump.c')
-rw-r--r-- | drivers/core/dump.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/core/dump.c b/drivers/core/dump.c index e73ebeabcc..b5046398d4 100644 --- a/drivers/core/dump.c +++ b/drivers/core/dump.c @@ -107,7 +107,8 @@ void dm_dump_drivers(void) puts("Driver Compatible\n"); puts("--------------------------------\n"); for (entry = d; entry < d + n_ents; entry++) { - for (match = entry->of_match; match->compatible; match++) + for (match = entry->of_match; + match && match->compatible; match++) printf("%-20.20s %s\n", match == entry->of_match ? entry->name : "", match->compatible); |