Skip to content
Snippets Groups Projects
Commit 1a596c44 authored by Simon Glass's avatar Simon Glass Committed by Tom Rini
Browse files

test: pwm: 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: default avatarSimon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 161690)
Fixes: 43b41566 (dm: sandbox: pwm: Add a basic pwm test)
parent 50258977
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ static int dm_test_pwm_base(struct unit_test_state *uts)
struct udevice *dev;
ut_assertok(uclass_get_device(UCLASS_PWM, 0, &dev));
ut_assertnonnull(dev);
ut_assertok(pwm_set_config(dev, 0, 100, 50));
ut_assertok(pwm_set_enable(dev, 0, true));
ut_assertok(pwm_set_enable(dev, 1, true));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment