Commit 62cc82e6 authored by mnlife's avatar mnlife Committed by Mark Brown

ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access

When snd_soc_card_jack_new is not called or the call fails,
calling this function causes a null pointer access
Signed-off-by: default avatarmnlife <mnlife@126.com>
Link: https://lore.kernel.org/r/20230811142511.6570-1-mnlife@126.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 273bc8bf
...@@ -37,7 +37,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask) ...@@ -37,7 +37,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
struct snd_soc_jack_pin *pin; struct snd_soc_jack_pin *pin;
unsigned int sync = 0; unsigned int sync = 0;
if (!jack) if (!jack || !jack->jack)
return; return;
trace_snd_soc_jack_report(jack, mask, status); trace_snd_soc_jack_report(jack, mask, status);
......
Markdown is supported
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