Commit 92598bdb authored by Simon Glass's avatar Simon Glass Committed by Tom Rini
Browse files

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's avatarSimon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 316351)
parent 9d9bec21
......@@ -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];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment