summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorPawel Harlozinski <pawel.harlozinski@linux.intel.com>2019-11-12 14:02:36 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-17 20:39:27 +0100
commit51fb33d0b2b1c9bb69e5612eae5b57837f767e71 (patch)
tree14395906bb5c108843d506367a15ee4447d5d8e1 /sound
parent9e0f33da9079a3e4e3acd5bdf163963b901d8484 (diff)
ASoC: Jack: Fix NULL pointer dereference in snd_soc_jack_report
commit 8f157d4ff039e03e2ed4cb602eeed2fd4687a58f upstream. Check for existance of jack before tracing. NULL pointer dereference has been reported by KASAN while unloading machine driver (snd_soc_cnl_rt274). Signed-off-by: Pawel Harlozinski <pawel.harlozinski@linux.intel.com> Link: https://lore.kernel.org/r/20191112130237.10141-1-pawel.harlozinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-jack.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index 99902ae1a2d9..b04ecc633da3 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -127,10 +127,9 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
unsigned int sync = 0;
int enable;
- trace_snd_soc_jack_report(jack, mask, status);
-
if (!jack)
return;
+ trace_snd_soc_jack_report(jack, mask, status);
dapm = &jack->card->dapm;