]> git.hungrycats.org Git - linux/commit
leds: Fix BUG_ON check for LED_COLOR_ID_MULTI that is always false
authorMarek Behún <kabel@kernel.org>
Tue, 1 Aug 2023 15:16:23 +0000 (17:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:36 +0000 (09:48 +0200)
commite2a579c5a997580bcb0fd87fb7e85c3981afd1d4
treeccdfad61ca93661dd29c4d96ea2c0281b566e994
parent92e1279daf077329f6dcb20b0318b1c2426081b6
leds: Fix BUG_ON check for LED_COLOR_ID_MULTI that is always false

[ Upstream commit c3f853184bed04105682383c2971798c572226b5 ]

At the time we call
    BUG_ON(props.color == LED_COLOR_ID_MULTI);
the props variable is still initialized to zero.

Call the BUG_ON only after we parse fwnode into props.

Fixes: 77dce3a22e89 ("leds: disallow /sys/class/leds/*:multi:* for now")
Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://lore.kernel.org/r/20230801151623.30387-1-kabel@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/leds/led-core.c