leds: pwm-multicolor: Add check for fwnode_property_read_u32
[ Upstream commit 6d91124e7edc109f114b1afe6d00d85d0d0ac174 ] 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2059e6ea11
commit
ff01e0d0a6
@@ -135,8 +135,11 @@ static int led_pwm_mc_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
/* init the multicolor's LED class device */
|
/* init the multicolor's LED class device */
|
||||||
cdev = &priv->mc_cdev.led_cdev;
|
cdev = &priv->mc_cdev.led_cdev;
|
||||||
fwnode_property_read_u32(mcnode, "max-brightness",
|
ret = fwnode_property_read_u32(mcnode, "max-brightness",
|
||||||
&cdev->max_brightness);
|
&cdev->max_brightness);
|
||||||
|
if (ret)
|
||||||
|
goto release_mcnode;
|
||||||
|
|
||||||
cdev->flags = LED_CORE_SUSPENDRESUME;
|
cdev->flags = LED_CORE_SUSPENDRESUME;
|
||||||
cdev->brightness_set_blocking = led_pwm_mc_set;
|
cdev->brightness_set_blocking = led_pwm_mc_set;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user