Skip to content
Unverified Commit 26b9f2fa authored by Alexandru Elisei's avatar Alexandru Elisei Committed by Mark Brown
Browse files

ASoC: rockchip: i2s: Fix NULL pointer dereference when pinctrl is not found

Commit a5450aba ("ASoC: rockchip: i2s: switch BCLK to GPIO") switched
BCLK to GPIO functions when probing the i2s bus interface, but missed
adding a check for when devm_pinctrl_get() returns an error.  This can lead
to the following NULL pointer dereference on a rockpro64-v2 if there are no
"pinctrl" properties in the i2s device tree node.

Check that i2s->pinctrl is valid before attempting to search for the
bclk_on and bclk_off pinctrl states.

Fixes: a5450aba

 ("ASoC: rockchip: i2s: switch BCLK to GPIO")
Signed-off-by: default avatarAlexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20220711130522.401551-1-alexandru.elisei@arm.com
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fc976f56
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment