mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-22 07:01:39 +00:00
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)
This commit is contained in:
parent
9d9bec216d
commit
92598bdbae
1 changed files with 4 additions and 2 deletions
|
@ -235,8 +235,10 @@ static int pwm_backlight_of_to_plat(struct udevice *dev)
|
||||||
priv->levels = malloc(len);
|
priv->levels = malloc(len);
|
||||||
if (!priv->levels)
|
if (!priv->levels)
|
||||||
return log_ret(-ENOMEM);
|
return log_ret(-ENOMEM);
|
||||||
dev_read_u32_array(dev, "brightness-levels", priv->levels,
|
ret = dev_read_u32_array(dev, "brightness-levels", priv->levels,
|
||||||
count);
|
count);
|
||||||
|
if (ret)
|
||||||
|
return log_msg_ret("levels", ret);
|
||||||
priv->num_levels = count;
|
priv->num_levels = count;
|
||||||
priv->default_level = priv->levels[index];
|
priv->default_level = priv->levels[index];
|
||||||
priv->max_level = priv->levels[count - 1];
|
priv->max_level = priv->levels[count - 1];
|
||||||
|
|
Loading…
Add table
Reference in a new issue