backlight: qcom-wled: Validate enabled string indices in DT
authorMarijn Suijten <marijn.suijten@somainline.org>
Mon, 15 Nov 2021 20:34:51 +0000 (21:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:53:59 +0000 (10:53 +0100)
commitf4ed4fc504fda6fd001b053d1e369ad632293158
tree9332ddd9054bd8d58a2a045ac07b78db5fbeb8eb
parente668ac6506d3f45bf36b1f8463f62ce5e2776732
backlight: qcom-wled: Validate enabled string indices in DT

[ Upstream commit c05b21ebc5bce3ecc78c2c71afd76d92c790a2ac ]

The strings passed in DT may possibly cause out-of-bounds register
accesses and should be validated before use.

Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for WLED3")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211115203459.1634079-2-marijn.suijten@somainline.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/backlight/qcom-wled.c