summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2015-06-04 16:04:14 +0300
committerMark Brown <broonie@kernel.org>2015-06-04 17:49:46 +0100
commit80ba2669ec8c3e6517aa935001f6cb8809bf3df4 (patch)
tree7014149c60e2edadbfb3407a6dbf23441fe2cc13
parentea178d1456dcf88875d5edd148f2df8ea0de1794 (diff)
downloadop-kernel-dev-80ba2669ec8c3e6517aa935001f6cb8809bf3df4.zip
op-kernel-dev-80ba2669ec8c3e6517aa935001f6cb8809bf3df4.tar.gz
ASoC: tas2552: Fix kernel crash when the codec is loaded but not part of a card
If the card is not part of any card the tas_data->codec is NULL since it is set only during snd_soc_codec_driver.probe, which is not yet called. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-rw-r--r--sound/soc/codecs/tas2552.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c
index ff82f46..df89947 100644
--- a/sound/soc/codecs/tas2552.c
+++ b/sound/soc/codecs/tas2552.c
@@ -120,6 +120,9 @@ static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown)
{
u8 cfg1_reg;
+ if (!tas_data->codec)
+ return;
+
if (sw_shutdown)
cfg1_reg = 0;
else
OpenPOWER on IntegriCloud