Skip to content

Commit 6d91124

Browse files
AnnYugawalag-linaro
authored andcommitted
leds: pwm-multicolor: Add check for fwnode_property_read_u32
Add a check to the return value of fwnode_property_read_u32() in case it fails. Signed-off-by: Yuanjun Gong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 7a33504 commit 6d91124

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/leds/rgb/leds-pwm-multicolor.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,11 @@ static int led_pwm_mc_probe(struct platform_device *pdev)
141141

142142
/* init the multicolor's LED class device */
143143
cdev = &priv->mc_cdev.led_cdev;
144-
fwnode_property_read_u32(mcnode, "max-brightness",
144+
ret = fwnode_property_read_u32(mcnode, "max-brightness",
145145
&cdev->max_brightness);
146+
if (ret)
147+
goto release_mcnode;
148+
146149
cdev->flags = LED_CORE_SUSPENDRESUME;
147150
cdev->brightness_set_blocking = led_pwm_mc_set;
148151

0 commit comments

Comments
 (0)