Skip to content

Commit

Permalink
ASoC: Jack: Fix NULL pointer dereference in snd_soc_jack_report
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Pawel Harlozinski authored and Mark Brown committed Nov 12, 2019
1 parent 130d3e9 commit 8f157d4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sound/soc/soc-jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,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;

Expand Down

0 comments on commit 8f157d4

Please sign in to comment.