]> git.baikalelectronics.ru Git - kernel.git/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:42:58 +0000 (09:42 +0200)
commitf741121a2251ea09c23877388d18c3aa2189de86
tree25e733992a9303a950dd1d3b12386936cd340d30
parenta253c416e67d4de9a338c8367c69ad85bb88253c
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