diff options
author | Simon Glass <sjg@chromium.org> | 2017-06-07 16:28:43 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-06-12 12:38:09 (GMT) |
commit | 9eace7f59ee4a37a678e4b57dc3fe532283f9226 (patch) | |
tree | 4458e22cb986868ab2d00325caea60502cf51577 | |
parent | 9f95267271c0b6cff64c5ac1b308e1e0281e9e3a (diff) | |
download | u-boot-9eace7f59ee4a37a678e4b57dc3fe532283f9226.tar.xz |
test: wdt: Add a check that dev is not NULL
We know that uclass_get_device() does not return NULL for dev when it
succeeds but coverity does not. Add an extra check to hopefully keep it
happy.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 163247)
Fixes: 0753bc2 (dm: Simple Watchdog uclass)
-rw-r--r-- | test/dm/wdt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/dm/wdt.c b/test/dm/wdt.c index 2ecfcea..0116502 100644 --- a/test/dm/wdt.c +++ b/test/dm/wdt.c @@ -20,6 +20,7 @@ static int dm_test_wdt_base(struct unit_test_state *uts) const u64 timeout = 42; ut_assertok(uclass_get_device(UCLASS_WDT, 0, &dev)); + ut_assertnonnull(dev); ut_asserteq(0, state->wdt.counter); ut_asserteq(false, state->wdt.running); |