summaryrefslogtreecommitdiff
path: root/sound/soc/soc-jack.c
diff options
context:
space:
mode:
authormnlife <mnlife@126.com>2023-08-11 22:25:11 +0800
committerMark Brown <broonie@kernel.org>2023-08-14 22:10:35 +0100
commit62cc82e6486b9b66b340bbf5fb38b0171fb56a7f (patch)
tree42f300e1642bdc39f40b66d0cdb69a6fb52cdbd9 /sound/soc/soc-jack.c
parent273bc8bf2227108ed2851bea71786a026e34ecbb (diff)
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: mnlife <mnlife@126.com> Link: https://lore.kernel.org/r/20230811142511.6570-1-mnlife@126.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-jack.c')
-rw-r--r--sound/soc/soc-jack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index f951acb2ce36..b2cc13b9c77b 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -37,7 +37,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
struct snd_soc_jack_pin *pin;
unsigned int sync = 0;
- if (!jack)
+ if (!jack || !jack->jack)
return;
trace_snd_soc_jack_report(jack, mask, status);