From 1a596c44c0967b3191ee278f988d14d6082249e1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 7 Jun 2017 10:28:38 -0600 Subject: 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: Simon Glass Reported-by: Coverity (CID: 161690) Fixes: 43b4156 (dm: sandbox: pwm: Add a basic pwm test) diff --git a/test/dm/pwm.c b/test/dm/pwm.c index f1e38c7..6b2dedf 100644 --- a/test/dm/pwm.c +++ b/test/dm/pwm.c @@ -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)); -- cgit v0.10.2