From: mnlife Date: Fri, 11 Aug 2023 14:25:11 +0000 (+0800) Subject: ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access X-Git-Tag: v6.6.7~1940^2^2~70 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62cc82e6486b9b66b340bbf5fb38b0171fb56a7f;p=platform%2Fkernel%2Flinux-starfive.git 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 Link: https://lore.kernel.org/r/20230811142511.6570-1-mnlife@126.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index f951acb..b2cc13b 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);