[PATCH v2 02/16] video: Check return value in pwm_backlight_of_to_plat()
Simon Glass
sjg at chromium.org
Fri May 14 03:39:18 CEST 2021
This cannot actually fail, but check the value anyway to keep coverity
happy.
Signed-off-by: Simon Glass <sjg at chromium.org>
Reported-by: Coverity (CID: 316351)
---
(no changes since v1)
drivers/video/pwm_backlight.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c
index 4c86215bd73..d7c096923b3 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];
--
2.31.1.751.gd2f1c929bd-goog
More information about the U-Boot
mailing list