diff options
author | Simon Glass <sjg@chromium.org> | 2021-05-14 04:39:18 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-07-16 01:42:05 +0300 |
commit | 92598bdbaef2c73566cd4a4ba8bd40889b0848ce (patch) | |
tree | a8613f175cdf1f176b9189a3508a4aa26be076a6 /drivers/video | |
parent | 9d9bec216d4207b3f3336eda2ca2ba73698574cb (diff) | |
download | u-boot-92598bdbaef2c73566cd4a4ba8bd40889b0848ce.tar.xz |
video: Check return value in pwm_backlight_of_to_plat()
This cannot actually fail, but check the value anyway to keep coverity
happy.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 316351)
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/pwm_backlight.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c index 4c86215bd7..d7c096923b 100644 --- a/drivers/video/pwm_backlight.c +++ b/drivers/video/pwm_backlight.c @@ -235,8 +235,10 @@ static int pwm_backlight_of_to_plat(struct udevice *dev) priv->levels = malloc(len); if (!priv->levels) return log_ret(-ENOMEM); - dev_read_u32_array(dev, "brightness-levels", priv->levels, - count); + ret = dev_read_u32_array(dev, "brightness-levels", priv->levels, + count); + if (ret) + return log_msg_ret("levels", ret); priv->num_levels = count; priv->default_level = priv->levels[index]; priv->max_level = priv->levels[count - 1]; |