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 10:03:45 +0000 (11:03 +0100)
commitf2bc76de284705432ea4b323cde3dada4892ed56
treea6af8fea369355038ea2755af93b5093140d3eaa
parent77c5e99644af10d94c6ce32d580d72b81267c933
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