]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: rockchip: i2s: Fix crash on missing pinctrl
authorChen-Yu Tsai <wens@csie.org>
Tue, 21 Jun 2022 18:57:47 +0000 (02:57 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 22 Jun 2022 12:39:37 +0000 (13:39 +0100)
commitc93c725fe26a75ee6d9738f5d508655f6a46ead8
treef41786a0bf21e42bdc7b3df1577a4bdb8a5e0aca
parent82746b2e2908134d71870c4fa29b34151f3e7555
ASoC: rockchip: i2s: Fix crash on missing pinctrl

Commit c45e559c1fca ("ASoC: rockchip: i2s: switch BCLK to GPIO") added
pinctrl lookups, but did not skip the lookup if there was no pinctrl
device tied to the I2S controller. As a result, the lookup was done
on an invalid pointer in such cases, causing a kernel panic.

Only do the subsequent pinctrl state lookups and switch if a pinctrl
device was found.

i2s_pinctrl_select_bclk_{on,off} already guard against missing pinctrl
device or pinctrl state, so those two functions aren't touched.

Fixes: c45e559c1fca ("ASoC: rockchip: i2s: switch BCLK to GPIO")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20220621185747.2782-1-wens@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/rockchip/rockchip_i2s.c