ASoC: Jack: Fix NULL pointer dereference in snd_soc_jack_report
authorPawel Harlozinski <pawel.harlozinski@linux.intel.com>
Tue, 12 Nov 2019 13:02:36 +0000 (14:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Dec 2019 09:42:01 +0000 (10:42 +0100)
commit3c4cab81a1ad3bc542b56e31f3aef94dc1b8b26a
tree3d40152243cb327210638f732091e0dbf6725139
parent4f5b0c735993482bfcc711fefc623a5e7babd011
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>
sound/soc/soc-jack.c