mirror of
https://github.com/frank-w/u-boot.git
synced 2026-01-08 17:32:59 +08:00
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)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user