]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: rt7*-sdw: harden jack_detect_handler
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 6 Jun 2022 20:37:50 +0000 (15:37 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 24 Jun 2022 15:21:33 +0000 (16:21 +0100)
commit5d077d5b356003743706448aef36e996ee66d644
tree16c98797366fda4531ef6f68dba0cc774c690d90
parent4bc4bd25d68794ea6a3a0da22ade3e2c1c4d4c3b
ASoC: rt7*-sdw: harden jack_detect_handler

Realtek headset codec drivers typically check if the card is
instantiated before proceeding with the jack detection.

The rt700, rt711 and rt711-sdca are however missing a check on the
card pointer, which can lead to NULL dereferences encountered in
driver bind/unbind tests.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220606203752.144159-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt700.c
sound/soc/codecs/rt711-sdca.c
sound/soc/codecs/rt711.c