Skip to content

Commit 562b4f7

Browse files
AnnYugawagregkh
authored andcommitted
leds: pwm-multicolor: Add check for fwnode_property_read_u32
[ Upstream commit 6d91124 ] Add a check to the return value of fwnode_property_read_u32() in case it fails. Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> Link: https://lore.kernel.org/r/20250223121459.2889484-1-ruc_gongyuanjun@163.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent b8fcb1c commit 562b4f7

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
@@ -135,8 +135,11 @@ static int led_pwm_mc_probe(struct platform_device *pdev)
135135

136136
/* init the multicolor's LED class device */
137137
cdev = &priv->mc_cdev.led_cdev;
138-
fwnode_property_read_u32(mcnode, "max-brightness",
138+
ret = fwnode_property_read_u32(mcnode, "max-brightness",
139139
&cdev->max_brightness);
140+
if (ret)
141+
goto release_mcnode;
142+
140143
cdev->flags = LED_CORE_SUSPENDRESUME;
141144
cdev->brightness_set_blocking = led_pwm_mc_set;
142145

0 commit comments

Comments
 (0)